Inheritance: extends PHPUnit_Framework_TestCase
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::spawnDatacenter();
     self::$server_api = new Swagger\Client\Api\ServerApi(self::$api_client);
     self::$lan_api = new Swagger\Client\Api\LanApi(self::$api_client);
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::spawnDatacenter();
     self::$server_api = new Swagger\Client\Api\ServerApi(self::$api_client);
     self::$nic_api = new Swagger\Client\Api\NetworkInterfacesApi(self::$api_client);
 }
 public static function setUpBeforeClass()
 {
     if (!self::$loader) {
         self::$loader = \ClassGenerator\Autoloader::getInstance()->setCachePath(__DIR__ . DIRECTORY_SEPARATOR . 'cache')->register();
         self::$generator = self::$loader->getGenerator();
     }
 }
 public function __construct()
 {
     parent::__construct();
     $matches = array();
     assert(preg_match("/host=([^;]+);(?:port=([^;]+);)?dbname=([^;]+)/", Yii::app()->db->connectionString, $matches) == 1);
     // Not Coding Standard
     if ($matches[2] != '') {
         $this->databasePort = intval($matches[2]);
     } else {
         $databaseType = RedBeanDatabase::getDatabaseTypeFromDsnString(Yii::app()->db->connectionString);
         $this->databasePort = DatabaseCompatibilityUtil::getDatabaseDefaultPort($databaseType);
     }
     $this->hostname = $matches[1];
     $this->rootUsername = Yii::app()->db->username;
     $this->rootPassword = Yii::app()->db->password;
     $this->existingDatabaseName = $matches[3];
     $this->temporaryDatabaseName = "zurmo_wacky";
     if ($this->rootUsername == 'zurmo') {
         $this->rootUsername = '******';
         $this->rootPassword = '******';
         $this->temporaryDatabaseName = 'zurmo_wacky';
     }
     $this->superUserPassword = '******';
     $this->databaseBackupTestFile = INSTANCE_ROOT . '/protected/runtime/databaseBackupTest.sql';
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     self::spawnDatacenter();
     self::$volume_api = new Swagger\Client\Api\VolumeApi(self::$api_client);
     self::$snapshot_api = new Swagger\Client\Api\SnapshotApi(self::$api_client);
 }
 public static function setUpBeforeClass()
 {
     self::$messaging = new Messaging();
     self::$messaging->authenticate(QUEUE_ACCOUNT, QUEUE_USERNAME, QUEUE_API_KEY);
     self::$queues = array();
     self::$topics = array();
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
 }
 public static function tearDownAfterClass()
 {
     // Remove test file
     @unlink(__DIR__ . '/test.jpg');
     // Tear down parent
     parent::tearDownAfterClass();
 }
 public function tearDown()
 {
     while (($language = array_pop($this->createdLanguages)) !== null) {
         $this->languageService->deleteLanguage($language);
     }
     parent::tearDown();
 }
Example #10
0
 public function setUp()
 {
     parent::setUp();
     $this->fsql = new Environment();
     $this->fsql->define_db('db1', parent::$tempDir);
     $this->fsql->select_db('db1');
 }
Example #11
0
 public function setUp()
 {
     parent::setUp();
     $fsql = new Environment();
     $fsql->define_db('db1', parent::$tempDir);
     $this->schema = $fsql->get_database('db1')->getSchema('public');
 }
Example #12
0
 public function setUp()
 {
     parent::setUp();
     $dir = __DIR__ . '/03/output';
     if (!is_dir($dir)) {
         mkdir($dir);
     }
 }
 /**
  * {@inheritdoc}
  */
 public static function tearDownAfterClass()
 {
     // Remove test file
     $file = __DIR__ . '/../translations/test.php';
     IOHelper::deleteFile($file);
     // Tear down parent
     parent::tearDownAfterClass();
 }
Example #14
0
 protected function getCompanyHome()
 {
     if (self::$_companyHome == null) {
         $nodes = $this->getSession()->query($this->getStore(), 'PATH:"app:company_home"');
         self::$_companyHome = $nodes[0];
     }
     return self::$_companyHome;
 }
 public static function setupBeforeClass()
 {
     parent::setUpBeforeClass();
     foreach (self::$testMessages as $source => $translation) {
         $sourceModel = MessageSource::addNewSource(self::$testCategory, $source);
         MessageTranslation::addNewTranslation(self::$testLanguageCode, $sourceModel, $translation);
     }
 }
 /**
  * {@inheritdoc}
  */
 public static function setUpBeforeClass()
 {
     // Set up parent
     parent::setUpBeforeClass();
     // Require dependencies
     require_once __DIR__ . '/../services/AuditLogService.php';
     require_once __DIR__ . '/../models/AuditLogModel.php';
 }
 public static function setUpBeforeClass()
 {
     self::$tokenStore = ObjectStorage_TokenStore::factory('file', array('ttl' => 3600, 'path' => '/tmp'));
     $options = array('adapter' => ObjectStorage_Http_Client::SOCKET, 'timeout' => 10);
     ObjectStorage::setTokenStore(self::$tokenStore);
     $objectStorage01 = new ObjectStorage(self::$host, self::$username, self::$password, $options);
     self::$objectStorage = $objectStorage01;
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     SecurityTestHelper::createSuperAdmin();
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     ModulesSearchWithDataProviderTestHelper::createCustomAttributesForModel(new TestOperatorTypeModel());
 }
Example #19
0
 public function setUp()
 {
     parent::setUp();
     $this->fsql = new Environment();
     $this->fsql->define_db('db1', parent::$tempDir);
     $this->fsql->select_db('db1');
     $this->sequences = new SequencesFile($this->fsql->current_schema());
 }
 function AdminPasswordConfirmed($params)
 {
     parent::BaseTest($params);
     if (!is_array($this->params) || count($this->params) <= 0) {
         ErrorStack::addError("Invalid parameters, you need to provide the password field names", ERRORSTACK_ERROR, 'AdminPasswordConfirmed');
         $this->result = INSTALLER_TEST_FAIL;
         return $this->result;
     }
 }
Example #21
0
 function PHPVersionUnder($params)
 {
     parent::BaseTest($params);
     if (!is_array($this->params) || count($this->params) <= 0) {
         ErrorStack::addError("Invalid parameters, version to test against must be supplied as the only item in an array", ERRORSTACK_ERROR, 'PHPVersionUnder');
         $this->result = INSTALLER_TEST_FAIL;
         return $this->result;
     }
 }
Example #22
0
 public function __construct($name)
 {
     parent::__construct($name);
     if (self::$fileName1 == null) {
         self::$fileName1 = "myDoc_" . time() . ".txt";
         self::$fileName2 = "myDoc2_" . time() . ".txt";
         self::$folderName1 = "folder1" . time();
     }
 }
Example #23
0
 public static function setUpBeforeClass()
 {
     require_once __DIR__ . '/../src/AutoLoaderClass.php';
     self::$loader = new AutoLoaderClass(__DIR__);
     self::$loader->mapNamespace('Hard\\Lesson', __DIR__ . '/Study/Math');
     self::$loader->mapNamespace('Hard\\Lesson', __DIR__ . '/Study/History');
     self::$loader->mapNamespace('MostHomework\\Lesson', __DIR__ . '/Study/Physics');
     self::$loader->register();
 }
 public function setup()
 {
     parent::setup();
     $this->model = new TestPrecisionModel();
     $viewStub = $this->getMockBuilder('AListView')->disableOriginalConstructor()->getMock();
     $this->view = $viewStub;
     $this->adapter = new DecimalListViewColumnAdapter('numberPositive5Precision', $this->view, array());
     $this->decimal = 'numberPositive5Precision';
 }
Example #25
0
 public function setUp()
 {
     parent::setUp();
     $fsql = new Environment();
     $database = new Database($fsql, 'db1', parent::$tempDir);
     $database->create();
     $this->schema = $database->getSchema('public');
     $this->sequences = new SequencesFile($this->schema);
 }
 public function setUp()
 {
     parent::setUp();
     $this->simpleXmls = array();
     $this->simpleXmls['WithSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithSignature.xml'));
     $this->simpleXmls['UnstructuredWithoutSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithoutSignatureUnstructuredRemittanceIdentifier.xml'));
     $this->simpleXmls['WithoutSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithoutSignature.xml'));
     $this->simpleXmls['UnstructuredWithSignature'] = new \SimpleXMLElement($this->GetEpsData('BankConfirmationDetailsWithSignatureUnstructuredRemittanceIdentifier.xml'));
 }
Example #27
0
 function DBVersionUnder($params)
 {
     parent::BaseTest($params);
     if (!is_array($this->params) || count($this->params) <= 0) {
         ErrorStack::addError("Invalid parameters, you need to provide the field names and version", ERRORSTACK_ERROR, 'DBVersionUnder');
         $this->result = INSTALLER_TEST_FAIL;
         return $this->result;
     }
 }
 public static function setUpBeforeClass()
 {
     parent::setUpBeforeClass();
     // Removes cached authentication data if any
     self::$objectStorage->reloadAuthenticationData();
     // This container will be used to test creation/update and delete
     self::$newContainerName = 'phpUnit_' . substr(md5(time()), 0, 7) . time();
     self::$newContainerMeta = 'META DATA TO TEST';
 }
 public function testCompound()
 {
     $x = new ResourceClasses\X(100);
     $d = new ResourceClasses\MethodOverridedDecoratorForX(array('getA' => function () {
         return parent::getA() + 1;
     }), $x);
     $this->assertEquals(100, $x->getA());
     $this->assertEquals(101, $d->getA());
 }
Example #30
0
 function WritableLocation($params)
 {
     parent::BaseTest($params);
     if (!is_array($this->params) || count($this->params) <= 0) {
         ErrorStack::addError("Invalid parameters, you must provide at least one location to test.", ERRORSTACK_ERROR, 'WritableLocation');
         $this->result = INSTALLER_TEST_FAIL;
         return $this->result;
     }
 }