Skip to content

Commit 17d8025

Browse files
Fix
1 parent 1188030 commit 17d8025

3 files changed

Lines changed: 12 additions & 31 deletions

File tree

tests/Admin/AdminTest.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace Sonata\ClassificationBundle\Tests\Admin;
1515

16-
use PHPUnit\Framework\MockObject\MockObject;
1716
use PHPUnit\Framework\TestCase;
1817
use Sonata\AdminBundle\Admin\AbstractAdmin;
1918
use Sonata\AdminBundle\Admin\AdminExtensionInterface;
@@ -46,21 +45,23 @@ public function testGetPersistentParametersWithNoExtension(): void
4645
'hide_context' => 0,
4746
];
4847

48+
$admin = new
4949
/** @phpstan-extends ContextAwareAdmin<ContextAwareInterface> */
50-
$admin = new class($this->contextManager) extends ContextAwareAdmin {};
50+
class($this->contextManager) extends ContextAwareAdmin {};
5151

5252
static::assertSame($expected, $admin->getPersistentParameters());
5353
}
5454

5555
public function testGetPersistentParametersWithValidExtension(): void
5656
{
57-
/** @phpstan-extends ContextAwareAdmin<ContextAwareInterface> */
58-
$admin = new class($this->contextManager) extends ContextAwareAdmin {
59-
public function __construct(ContextManagerInterface $contextManager)
60-
{
61-
parent::__construct($contextManager);
62-
}
63-
};
57+
$admin = new
58+
/** @phpstan-extends ContextAwareAdmin<ContextAwareInterface> */
59+
class($this->contextManager) extends ContextAwareAdmin {
60+
public function __construct(ContextManagerInterface $contextManager)
61+
{
62+
parent::__construct($contextManager);
63+
}
64+
};
6465

6566
$extension = $this->createMock(AdminExtensionInterface::class);
6667
$extension->expects(static::once())->method('configurePersistentParameters')->with(

tests/Entity/ContextTest.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/Model/ContextTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testSetterGetter(): void
2626
$time = new \DateTime();
2727

2828
$context = new class extends Context {
29-
public function getId(): ?string
29+
public function getId(): string
3030
{
3131
return '2';
3232
}
@@ -49,7 +49,7 @@ public function getId(): ?string
4949
public function testPreUpdate(): void
5050
{
5151
$context = new class extends Context {
52-
public function getId(): ?string
52+
public function getId(): string
5353
{
5454
return '42';
5555
}

0 commit comments

Comments
 (0)