mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix constructor signature of BaseContext (in BaseContextDataTest.php)
This commit is contained in:
parent
5481d029e8
commit
d1e09d7047
@ -28,7 +28,6 @@ final class BaseContextDataTest extends KernelTestCase
|
|||||||
|
|
||||||
protected function setUp(): void
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
|
||||||
self::bootKernel();
|
self::bootKernel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,12 +45,9 @@ final class BaseContextDataTest extends KernelTestCase
|
|||||||
|
|
||||||
public function testGenerateWithUser()
|
public function testGenerateWithUser()
|
||||||
{
|
{
|
||||||
$security = $this->prophesize(Security::class);
|
$context = $this->buildBaseContext();
|
||||||
$security->getUser()->willReturn(new User());
|
|
||||||
|
|
||||||
$context = $this->buildBaseContext($security->reveal());
|
$actual = $context->getData(new User());
|
||||||
|
|
||||||
$actual = $context->getData();
|
|
||||||
|
|
||||||
$this->assertIsArray($actual);
|
$this->assertIsArray($actual);
|
||||||
$this->assertArrayHasKey('creator', $actual);
|
$this->assertArrayHasKey('creator', $actual);
|
||||||
@ -60,11 +56,9 @@ final class BaseContextDataTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function buildBaseContext(
|
private function buildBaseContext(
|
||||||
?Security $security = null,
|
|
||||||
?NormalizerInterface $normalizer = null
|
?NormalizerInterface $normalizer = null
|
||||||
): BaseContextData {
|
): BaseContextData {
|
||||||
return new BaseContextData(
|
return new BaseContextData(
|
||||||
$security ?? self::$container->get(Security::class),
|
|
||||||
$normalizer ?? self::$container->get(NormalizerInterface::class)
|
$normalizer ?? self::$container->get(NormalizerInterface::class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user