setUp() protected method

See also: PHPUnit_Framework_TestCase::setUp()
protected setUp ( )
Beispiel #1
0
 /**
  * {@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;
     }
 }
Beispiel #2
0
 /**
  * {@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.');
     }
 }
Beispiel #3
0
 /**
  * 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();
 }
Beispiel #4
0
 /**
  * {@inheritdoc}
  * @see Scalr\Tests.TestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
 }
Beispiel #5
0
 /**
  * {@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');
     }
 }