Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and github-actions[bot] committed Nov 13, 2024
1 parent 65f68ff commit 0451918
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/Controller/MediaAdminControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,27 @@ public function testListAction(): void
$this->configureSetFormTheme($formView, ['filterTheme']);
$this->configureSetCsrfToken('sonata.batch');
$this->configureRender('templateList', 'renderResponse');
/**
* @psalm-suppress DeprecatedMethod
*/
$matcher = static::exactly(3);

$matcher = static::exactly(3);
/**
* @psalm-suppress DeprecatedMethod
* @psalm-suppress MissingClosureParamType
*/
$datagrid->expects($matcher)->method('setValue')->willReturnCallback(function (...$parameters) use ($matcher) {
if ($matcher->getInvocationCount() === 1) {
$this->assertSame('context', $parameters[0]);
$this->assertSame(null, $parameters[1]);
$this->assertSame('another_context', $parameters[2]);
/**
* @psalm-suppress InternalMethod
*/
if (1 === $matcher->getInvocationCount()) {
self::assertSame('context', $parameters[0]);
self::assertNull($parameters[1]);
self::assertSame('another_context', $parameters[2]);
}
if ($matcher->getInvocationCount() === 2) {
$this->assertSame('category', $parameters[0]);
$this->assertSame(null, $parameters[1]);
$this->assertSame(1, $parameters[2]);
/**
* @psalm-suppress InternalMethod
*/
if (2 === $matcher->getInvocationCount()) {
self::assertSame('category', $parameters[0]);
self::assertNull($parameters[1]);
self::assertSame(1, $parameters[2]);
}
});
$datagrid->method('getForm')->willReturn($form);
Expand Down

0 comments on commit 0451918

Please sign in to comment.