Skip to content

Commit facef51

Browse files
committed
Add AbstractTestContainer class
1 parent 35ae212 commit facef51

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/AbstractTestContainer.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace SimpleSAML\TestUtils;
6+
7+
/**
8+
* Class \SimpleSAML\TestUtils\AbstractTestContainer
9+
*/
10+
abstract class AbstractTestContainer
11+
{
12+
protected static AbstractTestContainer $testContainer;
13+
14+
15+
/** Set a container to use. */
16+
public static function setContainer(AbstractTestContainer $testContainer): void
17+
{
18+
self::$testContainer = $testContainer;
19+
}
20+
21+
22+
public static function getContainer(): AbstractTestContainer
23+
{
24+
Assert::notNull(self::$testContainer, 'No container set.');
25+
return self::$testContainer;
26+
}
27+
}

0 commit comments

Comments
 (0)