Skip to content

Commit bacc7bc

Browse files
committed
~
1 parent 69fdd3e commit bacc7bc

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

tests/Spinner/Functional/Complex/Config/ForcedSynchronousModeTest.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ public function synchronousModeCanBeForcedOne(): void
7070
$this->expectException(DomainException::class);
7171
$this->expectExceptionMessage('Loop is not set.');
7272

73-
self::extractContainer()
74-
->get(ILoopProvider::class)
75-
->getLoop()
76-
;
73+
$loop = self::getService(ILoopProvider::class)->getLoop();
7774

7875
self::fail('Exception was not thrown.');
7976
}
@@ -100,10 +97,7 @@ public function synchronousModeCanBeForcedTwo(): void
10097
$this->expectException(DomainException::class);
10198
$this->expectExceptionMessage('Loop is not set.');
10299

103-
self::extractContainer()
104-
->get(ILoopProvider::class)
105-
->getLoop()
106-
;
100+
$loop = self::getService(ILoopProvider::class)->getLoop();
107101

108102
self::fail('Exception was not thrown.');
109103
}
@@ -122,10 +116,7 @@ public function synchronousModeCanBeForcedThree(): void
122116
$this->expectException(DomainException::class);
123117
$this->expectExceptionMessage('Loop is not set.');
124118

125-
self::extractContainer()
126-
->get(ILoopProvider::class)
127-
->getLoop()
128-
;
119+
$loop = self::getService(ILoopProvider::class)->getLoop();
129120

130121
self::fail('Exception was not thrown.');
131122
}

tests/TestCase/ConfigurationTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ abstract class ConfigurationTestCase extends ContainerModifyingTestCase
1111
{
1212
protected static function getRequiredConfig(string $class): IConfigElement
1313
{
14-
$config = self::extractContainer()->get($class);
14+
$config = self::getService($class);
1515
if ($config instanceof IConfigElement && is_a($config, $class, true)) {
1616
return $config;
1717
}

tests/TestCase/FacadeAwareTestCase.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,16 @@ private static function storeContainer(): void
3030
self::$container = self::extractContainer();
3131
}
3232

33-
protected static function extractContainer(): mixed
33+
private static function extractContainer(): mixed
3434
{
3535
return self::callMethod(Facade::class, self::GET_CONTAINER);
3636
}
3737

38+
protected static function getService(string $id): mixed
39+
{
40+
return self::extractContainer()->get($id);
41+
}
42+
3843
protected static function setTestContainer(): void
3944
{
4045
self::setContainer(null);

0 commit comments

Comments
 (0)