Added test for GenericContainer implementation + implemented exec related stuff

This commit is contained in:
Sergei Shitikov
2024-09-01 19:40:55 +02:00
parent 93c9895027
commit a956794279
2 changed files with 67 additions and 17 deletions
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Testcontainers\Tests\Integration;
use Testcontainers\Container\GenericContainer;
class GenericContainerTest extends ContainerTestCase
{
public static function setUpBeforeClass(): void
{
self::$container = (new GenericContainer('alpine'))
->withCommand(['tail', '-f', '/dev/null'])
->start();
}
public function testExec(): void
{
$actual = self::$container->exec(['echo', 'testcontainers']);
self::assertSame('testcontainers', $actual);
}
}