/** * {@inheritdoc} * @see PHPUnit_Framework_TestCase::setUp() */ protected function setUp() { parent::setUp(); $this->container = \Scalr::getContainer(); $this->environment = new \Scalr_Environment(); if (!$this->isSkipFunctionalTests()) { $this->environment->loadById(\Scalr::config('scalr.phpunit.envid')); $this->container->environment = $this->environment; } }
/** * {@inheritdoc} * @see PHPUnit_Framework_TestCase::setUp() */ protected function setUp() { parent::setUp(); $this->errorLevel = error_reporting(); $this->markTestSkippedIfFunctionalTestsDisabled(); if (\Scalr::config('scalr.phpunit.userid')) { $this->_testUserId = \Scalr::config('scalr.phpunit.userid'); } if (\Scalr::config('scalr.phpunit.envid')) { $this->_testEnvId = \Scalr::config('scalr.phpunit.envid'); } if (!$this->isAdminUserTestClass() && (!empty($this->_testUserId) && $this->getUser()->isScalrAdmin())) { $this->markTestSkipped('Current test class cannot be passed with scalr admin session.'); } }
/** * Set test names for objects */ protected function setUp() { parent::setUp(); if ($this->isSkipFunctionalTests()) { $this->markTestSkipped(); } $testEnvId = \Scalr::config('scalr.phpunit.envid'); try { $this->testEnv = \Scalr_Environment::init()->loadById($testEnvId); } catch (Exception $e) { $this->markTestSkipped('Test Environment does not exist.'); } if (!$this->testEnv || !$this->testEnv->isPlatformEnabled(\SERVER_PLATFORMS::AZURE)) { $this->markTestSkipped('Azure platform is not enabled.'); } $this->azure = $this->testEnv->azure(); $this->subscriptionId = $this->azure->getEnvironment()->cloudCredentials(SERVER_PLATFORMS::AZURE)->properties[Entity\CloudCredentialsProperty::AZURE_SUBSCRIPTION_ID]; $this->resourceGroupName = 'test3-resource-group-' . $this->getInstallationId(); $this->availabilitySetName = 'test3-availability-set-' . $this->getInstallationId(); $this->vmName = 'test3-virtual-machine-' . $this->getInstallationId(); $this->vnName = 'test3-virtual-network-' . $this->getInstallationId(); $this->nicName = 'test3-network-interface' . $this->getInstallationId(); $this->publicIpName = 'myPublicIP3'; $this->storageName = 'teststorage3' . $this->getInstallationId(); $this->sgName = 'test3-security-group' . $this->getInstallationId(); }
/** * {@inheritdoc} * @see Scalr\Tests.TestCase::setUp() */ protected function setUp() { parent::setUp(); }
/** * {@inheritdoc} * @see Scalr\Tests.WebTestCase::setUp() */ protected function setUp() { parent::setUp(); if (static::isSkippedFunctionalTest()) { $this->markTestSkipped(); } if (!\Scalr::getContainer()->config('scalr.system.api.enabled')) { $this->markTestSkipped('API is not enabled. See scalr.system.api.enabled'); } }