/** * Sets up before each test method runs. * * This mainly sets the base URL for the test application, and sets the * Selenese path to make it easier to locate/use Selenese HTML scripts. */ public function setUp() { if (X2_TEST_DEBUG_LEVEL > 1) { /**/ println("\nrunning test case: " . $this->getName()); } if (X2_SKIP_ALL_TESTS || self::$skipAllTests) { $this->markTestSkipped(); } if (self::$loadFixturesForClassOnly) { $this->getFixtureManager()->loadFixtures = true; } $fixtures = is_array($this->fixtures) ? $this->fixtures : array(); $this->fixtures = array_merge($fixtures, static::referenceFixtures()); if (X2_TEST_DEBUG_LEVEL > 1) { println(' ' . $this->getName()); } X2DbTestCase::setUpAppEnvironment(true); if (isset($_SESSION)) { $this->_oldSession = $_SESSION; } parent::setUp(); $this->setSeleneseDir(); // Set the screenshot path to one visible from the web. //$this->screenshotPath = Yii::app()->basePath . implode(DIRECTORY_SEPARATOR, array('', '..', 'uploads', 'testing')); //$this->screenshotUrl = rtrim(TEST_BASE_URL, 'index-test.php') . 'uploads/testing'; $this->setBrowserUrl(TEST_BASE_URL); $this->prepareTestSession(); if ($this->autoLogin) { $this->openX2('/site/login'); $this->session(); } }
public static function setUpBeforeClass() { X2DbTestCase::setUpAppEnvironment(); return parent::setUpBeforeClass(); }
/** * Sets up before each test method runs. * * This mainly sets the base URL for the test application, and sets the * Selenese path to make it easier to locate/use Selenese HTML scripts. */ protected function setUp() { if (self::$skipAllTests) { $this->markTestSkipped(); } if (self::$loadFixturesForClassOnly) { $this->getFixtureManager()->loadFixtures = true; } // print out test name VERBOSE_MODE && println("\n" . $this->getName()); X2DbTestCase::setUpAppEnvironment(true); parent::setUp(); $this->setSeleneseDir(); // Set the screenshot path to one visible from the web. //$this->screenshotPath = Yii::app()->basePath . implode(DIRECTORY_SEPARATOR, array('', '..', 'uploads', 'testing')); //$this->screenshotUrl = rtrim(TEST_BASE_URL, 'index-test.php') . 'uploads/testing'; $this->setBrowserUrl(TEST_BASE_URL); $this->prepareTestSession(); if ($this->autoLogin) { $this->openX2('/site/login'); $this->session(); } }