final class MySqlRelease

Resolves a MySQL release number to the container that runs it.

Tests and fuzz targets start the release named by MYSQL_VERSION, so CI runs the newest release and a developer runs any other release locally by setting the variable.

Resolve the container of a releasedoctest
assert(\Container\MySqlRelease::container('8.4.7') === \Container\MySql84Container::class);
Resolve the release named by the environment, falling back to the defaultdoctest
putenv('MYSQL_VERSION');
    assert(\Container\MySqlRelease::fromEnvironment() === \Container\MySql84Container::class);

Constants§

public const DEFAULT = '8.4.7'
public const VARIABLE = 'MYSQL_VERSION'

Methods§

public static function versions(): list<string>

Lists the release numbers with a container, oldest first.

Returns

list<string>
Called from 2
Calls 2
public static function latest(): string

Names the newest release with a container.

Returns

string
Calls 3
public static function container(string|null $version = null): class-string<MySqlContainer>

Names the container of a release.

Parameters

$versionstring|nullRelease number such as `8.4.7`, or null for the default

Returns

class-string<MySqlContainer>

Throws

RuntimeException If no container runs the release
Called from 1
Calls 6
public static function fromEnvironment(string $variable = self::VARIABLE): class-string<MySqlContainer>

Names the container of the release given by an environment variable.

Parameters

$variablestringEnvironment variable holding the release number

Returns

class-string<MySqlContainer>

Throws

RuntimeException If no container runs the release
Test cases 198
Calls 3

Private surface 1§

Implementation details, listed for orientation only.

private const array<string, class-string<MySqlContainer>> CONTAINERS = ['5.6.51' => \Container\MySql56Container::class, '5.7.44' => \Container\MySql57…

Test cases 199§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Other tests reaching this symbol 199