/** * {@inheritdoc} * @see Scalr\Tests\TestCase::tearDown() */ protected function tearDown() { if (isset($this->governanceConfiguration)) { $this->restoreGovernanceConfiguration(); } parent::tearDown(); }
/** * Also Removes Cost Centers properties generated for test * * {@inheritdoc} * @see Scalr\Tests\Functional\Api\ApiTestCase::tearDownAfterClass() */ public static function tearDownAfterClass() { ksort(static::$testData, SORT_REGULAR); foreach (static::$testData as $priority => $data) { foreach ($data as $class => $ids) { if ($class === 'Scalr\\Stats\\CostAnalytics\\Entity\\CostCentreEntity') { $ids = array_unique($ids, SORT_REGULAR); foreach ($ids as $entry) { /* @var $cc CostCentreEntity */ $cc = $class::findPk(...$entry); if (!empty($cc)) { try { CostCentrePropertyEntity::deleteByCcId($cc->ccId); AccountCostCenterEntity::deleteByCcId($cc->ccId); $cc->delete(); } catch (\Exception $e) { \Scalr::logException($e); } } } unset(static::$testData[$priority][$class]); } } } parent::tearDownAfterClass(); }
public function __construct($name = null, $data = [], $dataName = null) { parent::__construct($name, $data, $dataName); $this->uuid = uniqid($this->getTestName()); }
/** * Also Removes Project properties generated for test * * {@inheritdoc} */ public static function tearDownAfterClass() { //We have to remove CostCenter properties as they don't have foreign keys foreach (static::$testData as $rec) { if ($rec['class'] === ProjectEntity::class) { ProjectPropertyEntity::deleteByProjectId($rec['pk'][0]); } } parent::tearDownAfterClass(); }
/** * {@inheritdoc} * @see TestCase::getFixturesDirectory() */ public function getFixturesDirectory() { return parent::getFixturesDirectory() . '/Api/V2/'; }