mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-12 08:29:34 +00:00
cleanup
This commit is contained in:
@@ -14,6 +14,7 @@ class Container extends GenericContainer
|
||||
protected ?StartedTestContainer $startedContainer = null;
|
||||
|
||||
protected ?StoppedTestContainer $stoppedContainer = null;
|
||||
|
||||
public static function make(string $image): self
|
||||
{
|
||||
return new self($image);
|
||||
@@ -61,7 +62,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function execute(array $commandAsArray): string
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -73,7 +74,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function logs(): string
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -85,7 +86,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function getAddress(): string
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function getPort(): int
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function stop(): self
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function restart(): self
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
@@ -148,7 +149,7 @@ class Container extends GenericContainer
|
||||
*/
|
||||
public function remove(): self
|
||||
{
|
||||
if($this->startedContainer === null) {
|
||||
if ($this->startedContainer === null) {
|
||||
throw new \RuntimeException('Container is not started');
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,6 @@ class MariaDBContainer extends Container
|
||||
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
|
||||
@@ -21,10 +21,6 @@ class MySQLContainer extends Container
|
||||
$this->withWait(new WaitForLog('ready for connections'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
@@ -44,4 +40,4 @@ class MySQLContainer extends Container
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,27 +26,15 @@ class OpenSearchContainer extends Container
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
}
|
||||
|
||||
public function withDisabledSecurityPlugin(): self
|
||||
public function disableSecurityPlugin(): self
|
||||
{
|
||||
$this->withEnvironment('plugins.security.disabled', 'true');
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use withDisabledSecurityPlugin instead
|
||||
*/
|
||||
public function disableSecurityPlugin(): self
|
||||
{
|
||||
return $this->withDisabledSecurityPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,10 +27,6 @@ class PostgresContainer extends Container
|
||||
$this->withWait(new WaitForExec(["pg_isready", "-h", "127.0.0.1", "-U", $this->username]));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $dbPassword = 'root'): self
|
||||
{
|
||||
return new self(
|
||||
|
||||
@@ -20,10 +20,6 @@ class RedisContainer extends Container
|
||||
$this->withWait(new WaitForLog('Ready to accept connections'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
|
||||
@@ -17,15 +17,6 @@ class MariaDBContainer extends GenericContainer
|
||||
$this->withEnvironment('MARIADB_ROOT_PASSWORD', $mysqlRootPassword);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
}
|
||||
|
||||
public function withMariaDBUser(string $username, string $password): self
|
||||
{
|
||||
$this->withEnvironment('MARIADB_USER', $username);
|
||||
|
||||
@@ -17,15 +17,6 @@ class MySQLContainer extends GenericContainer
|
||||
$this->withWait(new WaitForLog('ready for connections'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest', string $mysqlRootPassword = 'root'): self
|
||||
{
|
||||
return new self($version, $mysqlRootPassword);
|
||||
}
|
||||
|
||||
public function withMySQLUser(string $username, string $password): self
|
||||
{
|
||||
$this->withEnvironment('MYSQL_USER', $username);
|
||||
|
||||
@@ -37,12 +37,4 @@ class OpenSearchContainer extends GenericContainer
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use withDisabledSecurityPlugin instead
|
||||
*/
|
||||
public function disableSecurityPlugin(): self
|
||||
{
|
||||
return $this->withDisabledSecurityPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,4 @@ class RedisContainer extends GenericContainer
|
||||
$this->withExposedPorts(6379);
|
||||
$this->withWait(new WaitForLog('Ready to accept connections'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use constructor instead
|
||||
* Left for backward compatibility
|
||||
*/
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user