Skip to content

Commit

Permalink
style: Fix CS (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Feb 24, 2025
1 parent ff4a0f0 commit 1b14cba
Showing 1 changed file with 34 additions and 36 deletions.
70 changes: 34 additions & 36 deletions tests/Loader/LoaderIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ public function testTemplatesAreBuildBeforeUsage(): void
new ParameterBag(),
new ObjectBag([
'dummy' => new DummyWithConstructorAndCallable(null),
'foo-0' => new FixtureEntity\DummyWithConstructorParam(null),
'foo-0' => new DummyWithConstructorParam(null),
]),
);

Expand All @@ -891,7 +891,7 @@ public function testTemplatesAreBuildBeforeUsage(): void
'__construct' => ['foo'],
],
],
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'foo-0' => [
'__construct' => ['@dummy->foo'],
],
Expand Down Expand Up @@ -1395,7 +1395,7 @@ public function testInjectedParametersAndObjectsAreOverriddenByLocalParameters()
'foz' => '<{foo}>',
'foo' => 'baz',
],
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'another_dummy' => [
'__construct' => ['@dummy'],
],
Expand Down Expand Up @@ -1425,7 +1425,7 @@ public function testInjectedParametersAndObjectsAreOverriddenByLocalParameters()
'dummy' => $dummy = StdClassFactory::create([
'injected' => false,
]),
'another_dummy' => new FixtureEntity\DummyWithConstructorParam($dummy),
'another_dummy' => new DummyWithConstructorParam($dummy),
]),
);

Expand Down Expand Up @@ -2363,7 +2363,7 @@ public static function provideFixturesToGenerate(): iterable
],
],
],
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'dummy' => [
'__construct' => [
'@another_dummy',
Expand All @@ -2380,7 +2380,7 @@ public static function provideFixturesToGenerate(): iterable

return $anotherDummy1;
})(new FixtureEntity\OnceTimerDummy()),
'dummy' => $dummy1 = new FixtureEntity\DummyWithConstructorParam($yetAnotherDummy1),
'dummy' => $dummy1 = new DummyWithConstructorParam($yetAnotherDummy1),
],
],
];
Expand Down Expand Up @@ -3405,7 +3405,7 @@ public static function provideFixturesToGenerate(): iterable

yield '[current] in constructor' => [
[
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'dummy{1..2}' => [
'__construct' => ['<current()>'],
],
Expand All @@ -3417,10 +3417,10 @@ public static function provideFixturesToGenerate(): iterable
[
'parameters' => [],
'objects' => [
'dummy1' => new FixtureEntity\DummyWithConstructorParam(1),
'dummy2' => new FixtureEntity\DummyWithConstructorParam(2),
'dummy_alice' => new FixtureEntity\DummyWithConstructorParam('alice'),
'dummy_bob' => new FixtureEntity\DummyWithConstructorParam('bob'),
'dummy1' => new DummyWithConstructorParam(1),
'dummy2' => new DummyWithConstructorParam(2),
'dummy_alice' => new DummyWithConstructorParam('alice'),
'dummy_bob' => new DummyWithConstructorParam('bob'),
],
],
];
Expand Down Expand Up @@ -3595,7 +3595,7 @@ public static function provideFixturesToGenerate(): iterable
'ping' => 'pong',
'foo' => 'bar',
],
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'dummy' => [
'__construct' => [
[
Expand All @@ -3612,7 +3612,7 @@ public static function provideFixturesToGenerate(): iterable
'foo' => 'bar',
],
'objects' => [
'dummy' => new FixtureEntity\DummyWithConstructorParam([
'dummy' => new DummyWithConstructorParam([
'foo' => 'pong',
'bar' => 'bar',
]),
Expand Down Expand Up @@ -3706,7 +3706,7 @@ public static function provideFixturesToGenerate(): iterable

yield 'object circular reference' => [
[
FixtureEntity\DummyWithConstructorParam::class => [
DummyWithConstructorParam::class => [
'dummy' => [
'__construct' => [
'@another_dummy',
Expand Down Expand Up @@ -4203,30 +4203,28 @@ public static function provideFixturesToGenerate(): iterable
];
})();

yield 'allow to instantiate an entity with an array arguments' => (static function () {
return [
[
stdClass::class => [
'entity1' => [],
'entity2' => [],
'dummy' => [
'rootClass' => '<(new stdClass())>',
'instance' => '<(new Nelmio\Alice\Entity\DummyWithConstructorParam([@entity1, @entity2]))>',
],
yield 'allow to instantiate an entity with an array arguments' => (static fn () => [
[
stdClass::class => [
'entity1' => [],
'entity2' => [],
'dummy' => [
'rootClass' => '<(new stdClass())>',
'instance' => '<(new Nelmio\Alice\Entity\DummyWithConstructorParam([@entity1, @entity2]))>',
],
],
[
'parameters' => [],
'objects' => [
'entity1' => new stdClass(),
'entity2' => new stdClass(),
'dummy' => StdClassFactory::create([
'rootClass' => new stdClass(),
'instance' => new FixtureEntity\DummyWithConstructorParam([new stdClass(), new stdClass()]),
]),
],
],
[
'parameters' => [],
'objects' => [
'entity1' => new stdClass(),
'entity2' => new stdClass(),
'dummy' => StdClassFactory::create([
'rootClass' => new stdClass(),
'instance' => new DummyWithConstructorParam([new stdClass(), new stdClass()]),
]),
],
];
})();
],
])();
}
}

0 comments on commit 1b14cba

Please sign in to comment.