public function envTestEc2($envId)
{
if (!$this->getEnvironment()->isPlatformEnabled(\SERVER_PLATFORMS::EC2)) {
$this->markTestSkipped('Skip EC2 platform test');
}
$ccProps = $this->getEnvironment()->keychain(SERVER_PLATFORMS::EC2)->properties;
// enable EC2
$content = $this->request('/environments/' . $envId . '/platform/xSaveEc2', array('ec2.is_enabled' => '1', 'ec2.account_id' => $ccProps[Entity\CloudCredentialsProperty::AWS_ACCOUNT_ID], 'ec2.access_key' => $ccProps[Entity\CloudCredentialsProperty::AWS_ACCESS_KEY], 'ec2.secret_key' => $ccProps[Entity\CloudCredentialsProperty::AWS_SECRET_KEY]), 'POST', array(), array());
$this->assertFalse($content['success']);
// disable EC2
$content = $this->request('/environments/' . $envId . '/platform/xSaveEc2', array('ec2.is_enabled' => ''));
$this->assertTrue($content['success']);
$this->assertFalse($content['enabled']);
}