File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace CodedMonkey \Dirigent \Tests \Docker \Standalone ;
4+
5+ use PHPUnit \Framework \TestCase ;
6+ use Testcontainers \Container \GenericContainer ;
7+ use Testcontainers \Wait \WaitForLog ;
8+
9+ class PhpunitTest extends TestCase
10+ {
11+ public function testPhpunitTests (): void
12+ {
13+ $ container = (new GenericContainer ('dirigent-standalone ' ))
14+ ->withCommand (['bin/phpunit ' ])
15+ ->withMount (__DIR__ . '/.env.dirigent.test ' , '/srv/app/.env.dirigent.test ' )
16+ ->withMount (__DIR__ . '/bin/phpunit ' , '/srv/app/bin/phpunit ' )
17+ ->withMount (__DIR__ . '/phpunit.dist.xml ' , '/srv/app/phpunit.dist.xml ' )
18+ ->withMount (__DIR__ . '/vendor ' , '/srv/app/vendor ' )
19+ ->withWait (new WaitForLog ('Time: ' ))
20+ ->start ();
21+
22+ $ result = $ container ->logs ();
23+
24+ $ container ->stop ();
25+
26+ $ this ->assertStringContainsString ('OK ' , $ result , 'Running the PHPUnit tests inside ' );
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments