Scalr\Tests\Functional\Api\ApiTestCase::setUp PHP Method

setUp() protected method

protected 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');
        }
    }

Usage Example

示例#1
0
文件: ApiTest.php 项目: scalr/scalr
 /**
  * {@inheritdoc}
  * @see ApiTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     switch ($this->getName(false)) {
         case 'testGetEndpoint':
             if (!static::$user->canManageAcl()) {
                 $this->setUserType(User::TYPE_ACCOUNT_ADMIN);
             }
             $this->setTestAcl(ApiFixture::ACL_FULL_ACCESS);
             break;
         case 'testApi':
             if (static::$user->canManageAcl()) {
                 $this->markTestIncomplete("Specified test user has always full access. It's not valid for this test");
             }
             break;
     }
 }