setUp() protected method

This method is called before a test is executed.
protected setUp ( ) : void
return void
Beispiel #1
0
 protected function setUp()
 {
     parent::setUp();
     $sl = $this->getContainer();
     $services = $sl->findByType('Nette\\Application\\IRouter');
     $this->router = $sl->createService($services[0]);
 }
Beispiel #2
0
 public function setUp()
 {
     parent::setUp();
     if ($this->generateRandomString) {
         $this->randomStringGenerator = new CapturingRandomStringGenerator();
     } else {
         $this->randomStringGenerator = new DefaultTestRandomString();
     }
 }
 protected function setUp()
 {
     parent::setUp();
     try {
         $this->driver = $this->getDriver();
     } catch (PrerequisiteException $e) {
         Environment::skip($e->getMessage());
     }
 }
 function setUp()
 {
     parent::setUp();
     if (!$this->databaseExists) {
         $this->createTempDatabase();
         self::registerInstance($this);
     }
     try {
         $this->importFile($this->filename);
     } catch (\Exception $e) {
         \Tester\Assert::fail("Failed loading init SQL file: " . $e->getMessage());
     }
     $this->resetQueries();
 }
 protected function setUp()
 {
     parent::setUp();
     if (!$this->prepared) {
         try {
             $this->databaseTester->prepareDatabaseTest();
         } catch (DBALException $ex) {
             if (preg_match('~unknown database|access denied|2002|no such file~i', $ex->getMessage())) {
                 Environment::skip('No test SQL database available');
             } else {
                 throw $ex;
             }
         }
         $this->prepared = TRUE;
     } else {
         $this->databaseTester->clearDatabase();
     }
 }
Beispiel #6
0
 protected function setUp()
 {
     parent::setUp();
     Tester\Environment::lock('mysql_database', __DIR__ . '/../temporary');
     $this->database = $this->connection();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->lifeCycle->onSetUp();
 }
 function setUp()
 {
     parent::setUp();
     $this->tempDir = false;
 }
Beispiel #9
0
 /**
  * This method is called before a test is executed.
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     Tester\Environment::lock('database', __DIR__ . '/../temp');
     $this->connection->loadFile(__DIR__ . '/../DBstructure.sql');
 }