|
| 1 | +<?php |
| 2 | +declare(strict_types=1); |
| 3 | + |
| 4 | +use ThenLabs\PyramidalTests\Decorator\DecoratorsRegistry; |
| 5 | +use ThenLabs\PyramidalTests\DSL\Decorator\EndTestCaseDecorator; |
| 6 | +use ThenLabs\PyramidalTests\DSL\Decorator\SetUpBeforeClassDecorator; |
| 7 | +use ThenLabs\PyramidalTests\DSL\Decorator\SetUpBeforeClassOnceDecorator; |
| 8 | +use ThenLabs\PyramidalTests\DSL\Decorator\SetUpDecorator; |
| 9 | +use ThenLabs\PyramidalTests\DSL\Decorator\TearDownAfterClassDecorator; |
| 10 | +use ThenLabs\PyramidalTests\DSL\Decorator\TearDownAfterClassOnceDecorator; |
| 11 | +use ThenLabs\PyramidalTests\DSL\Decorator\TearDownDecorator; |
| 12 | +use ThenLabs\PyramidalTests\DSL\Decorator\TestCaseDecorator; |
| 13 | +use ThenLabs\PyramidalTests\DSL\Decorator\TestDecorator; |
| 14 | +use ThenLabs\PyramidalTests\DSL\DSL; |
| 15 | +use ThenLabs\PyramidalTests\Model\TestCaseModel; |
| 16 | +use ThenLabs\PyramidalTests\Model\TestModel; |
| 17 | + |
| 18 | +require_once __DIR__.'/Common.php'; |
| 19 | + |
| 20 | +DecoratorsRegistry::registerGlobal('testCase', new TestCaseDecorator()); |
| 21 | +DecoratorsRegistry::registerGlobal('endTestCase', new EndTestCaseDecorator()); |
| 22 | +DecoratorsRegistry::registerGlobal('setUpBeforeClass', new SetUpBeforeClassDecorator()); |
| 23 | +DecoratorsRegistry::registerGlobal('setUpBeforeClassOnce', new SetUpBeforeClassOnceDecorator()); |
| 24 | +DecoratorsRegistry::registerGlobal('setUp', new SetUpDecorator()); |
| 25 | +DecoratorsRegistry::registerGlobal('test', new TestDecorator()); |
| 26 | +DecoratorsRegistry::registerGlobal('tearDown', new TearDownDecorator()); |
| 27 | +DecoratorsRegistry::registerGlobal('tearDownAfterClass', new TearDownAfterClassDecorator()); |
| 28 | +DecoratorsRegistry::registerGlobal('tearDownAfterClassOnce', new TearDownAfterClassOnceDecorator()); |
| 29 | + |
| 30 | +function testCase($firstArgument = '', Closure $secondArgument = null): TestCaseModel |
| 31 | +{ |
| 32 | + return DSL::testCase($firstArgument, $secondArgument); |
| 33 | +} |
| 34 | + |
| 35 | +function setUpBeforeClass(Closure $closure, bool $invokeParents = true): void |
| 36 | +{ |
| 37 | + DSL::setUpBeforeClass($closure, $invokeParents); |
| 38 | +} |
| 39 | + |
| 40 | +function setUpBeforeClassOnce(Closure $closure, bool $invokeParents = true): void |
| 41 | +{ |
| 42 | + DSL::setUpBeforeClassOnce($closure, $invokeParents); |
| 43 | +} |
| 44 | + |
| 45 | +function setUp(Closure $closure, bool $invokeParents = true): void |
| 46 | +{ |
| 47 | + DSL::setUp($closure, $invokeParents); |
| 48 | +} |
| 49 | + |
| 50 | +/** |
| 51 | + * @param string|Closure |
| 52 | + * @param Closure|null |
| 53 | + */ |
| 54 | +function test($firstArgument, Closure $secondArgument = null): TestModel |
| 55 | +{ |
| 56 | + return DSL::test($firstArgument, $secondArgument); |
| 57 | +} |
| 58 | + |
| 59 | +function tearDown(Closure $closure, bool $invokeParents = true): void |
| 60 | +{ |
| 61 | + DSL::tearDown($closure, $invokeParents); |
| 62 | +} |
| 63 | + |
| 64 | +function tearDownAfterClass(Closure $closure, bool $invokeParents = true): void |
| 65 | +{ |
| 66 | + DSL::tearDownAfterClass($closure, $invokeParents); |
| 67 | +} |
| 68 | + |
| 69 | +function tearDownAfterClassOnce(Closure $closure, bool $invokeParents = true): void |
| 70 | +{ |
| 71 | + DSL::tearDownAfterClassOnce($closure, $invokeParents); |
| 72 | +} |
0 commit comments