use EnvTestBehaviour;
public function testSetsEnvironmentVariableToTrueIfTriggersCanBeCreated(): void
{ $this->
setEnvVars([BlueGreenDeploymentService::ENV_NAME => '0'
]);
$connection =
$this->
createMock(Connection::
class);
$connection->
expects(static::
exactly(3
))->
method('executeQuery'
);
$service =
new BlueGreenDeploymentService();
$session =
new Session(new MockArraySessionStorage());
$service->
setEnvironmentVariable($connection,
$session);
static::
assertTrue($_ENV[BlueGreenDeploymentService::ENV_NAME
]);
static::
assertTrue($_SERVER[BlueGreenDeploymentService::ENV_NAME
]);
static::
assertTrue(EnvironmentHelper::
getVariable(BlueGreenDeploymentService::ENV_NAME
));
static::
assertTrue($session->
get(BlueGreenDeploymentService::ENV_NAME
));
} public function testSetsEnvironmentVariableToFalseIfTriggersCanNotBeCreated(): void
{ $this->
setEnvVars([BlueGreenDeploymentService::ENV_NAME => '1'
]);