Beispiel #1
0
 /**
  * Remove TMP/tests directory to its original state.
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     $cleaner = function ($dir) use(&$cleaner) {
         $files = array_diff(scandir($dir), ['.', '..']);
         foreach ($files as $file) {
             $path = $dir . DIRECTORY_SEPARATOR . $file;
             if (is_dir($path)) {
                 $cleaner($path);
             } else {
                 unlink($path);
             }
         }
         rmdir($dir);
     };
     if (file_exists(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tests')) {
         $cleaner(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'tests');
     }
     parent::tearDown();
 }
Beispiel #2
0
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
 }
 /**
  * setup
  *
  * @return void
  */
 public function setup()
 {
     parent::setUp();
     $config = ConnectionManager::config('test');
     $this->skipIf(strpos($config['driver'], 'Mysql') === false, 'Not using Mysql for test config');
 }
Beispiel #4
0
 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     $this->file->close();
     unset($this->file);
 }
 /**
  * Setup
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->_mailTransport = $this->getMock('CoreTyson\\Mailer\\Transport\\MailTransport');
 }