Пример #1
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->previousApplication = \YapepBase\Application::getInstance();
     $this->object = new Mock\ApplicationMock();
     Application::setInstance($this->object);
 }
 public function setUp()
 {
     parent::setUp();
     $this->errorReportingLevel = error_reporting();
     error_reporting(E_ALL);
     Config::getInstance()->set('system.errorHandling.defaultIdTimeout', 0);
 }
Пример #3
0
 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     Config::getInstance()->set(array('resource.log.' . self::SYSLOG_CONNECTION_CONFIG_NAME . '.facility' => LOG_LOCAL5, 'resource.log.' . self::SYSLOG_CONNECTION_CONFIG_NAME . '.applicationIdent' => self::SYSLOG_CONNECTION_APPLICATION_INDENT, 'resource.log.' . self::SYSLOG_CONNECTION_CONFIG_NAME . '.includeSapiName' => false, 'resource.log.' . self::SYSLOG_CONNECTION_CONFIG_NAME . '.addPid' => false));
     $this->syslogConnectionMock = new SyslogConnectionMock();
     $this->syslogLogger = new SyslogLoggerMock(self::SYSLOG_CONNECTION_CONFIG_NAME, $this->syslogConnectionMock);
 }
Пример #4
0
 protected function tearDown()
 {
     parent::tearDown();
     while (ob_get_level() > $this->originalObLevel) {
         ob_end_flush();
     }
 }
Пример #5
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     parent::setUp();
     $this->fileHandler = new FileHandlerPhp();
     vfsStreamWrapper::register();
     try {
         $testPath = $this->getTestPath();
         // Remove the files
         foreach ($this->resourcesToRemove as $path) {
             $fullPath = $testPath . $path;
             if (is_file($fullPath)) {
                 unlink($fullPath);
             }
         }
         // Remove the directories
         foreach ($this->resourcesToRemove as $path) {
             $fullPath = $testPath . $path;
             if (is_dir($fullPath)) {
                 rmdir($fullPath);
             }
         }
     } catch (\PHPUnit_Framework_SkippedTestError $e) {
     } catch (\PHPUnit_Framework_AssertionFailedError $e) {
     }
 }
Пример #6
0
 public function tearDown()
 {
     $_GET = array();
     $_POST = array();
     $_COOKIE = array();
     $_ENV = array();
     parent::tearDown();
 }
Пример #7
0
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     if (!empty($this->subject)) {
         $this->subject->query('DROP TABLE IF EXISTS test');
     }
     $this->subject = null;
     parent::tearDown();
 }
Пример #8
0
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     if (!empty($this->config)) {
         $this->config->clear();
     }
     $this->config = null;
     DbFactory::clearConnections();
     parent::tearDown();
 }
Пример #9
0
 protected function tearDown()
 {
     parent::tearDown();
     Config::getInstance()->clear();
     $application = Application::getInstance();
     $application->setDiContainer($this->originalDiContainer);
     $application->clearI18nTranslator();
     while (ob_get_level() > $this->originalObLevel) {
         ob_end_flush();
     }
 }
Пример #10
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $container = new SystemContainer();
     $container[SystemContainer::KEY_MEMCACHE] = $container->share(function ($container) {
         return new MemcacheMock();
     });
     Application::getInstance()->setDiContainer($container);
     $this->memcacheMock = Application::getInstance()->getDiContainer()->getMemcache();
     Config::getInstance()->set(array('resource.storage.test.host' => 'localhost', 'resource.storage.test.readOnly' => false, 'resource.storage.test2.host' => 'localhost', 'resource.storage.test2.port' => 11222, 'resource.storage.test2.keyPrefix' => 'test.', 'resource.storage.test2.keySuffix' => '.test', 'resource.storage.test3.host' => 'localhost', 'resource.storage.test3.hashKey' => true, 'resource.storage.test3.keyPrefix' => 'test.', 'resource.storage.test4.port' => 11211, 'resource.storage.test5.host' => 'localhost', 'resource.storage.test5.readOnly' => true));
 }
Пример #11
0
 protected function tearDown()
 {
     parent::tearDown();
     $testPath = getenv('YAPEPBASE_TEST_TEMPPATH');
     if (empty($testPath)) {
         return;
     }
     if (file_exists($testPath)) {
         $fileHandler = new FileHandlerPhp();
         $fileHandler->removeDirectory($testPath, true);
     }
 }
Пример #12
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     parent::setUp();
     $directoryName = 'test';
     $filename = 'test.txt';
     $this->fileContent = 'test' . PHP_EOL . 'test' . PHP_EOL . 'test' . PHP_EOL . 'test';
     vfsStreamWrapper::register();
     $directory = new vfsStreamDirectory($directoryName);
     $file = new vfsStreamFile($filename);
     $file->setContent($this->fileContent);
     $directory->addChild($file);
     vfsStreamWrapper::setRoot($directory);
     $this->filePath = vfsStream::url($directoryName . DIRECTORY_SEPARATOR . $filename);
 }
Пример #13
0
 public function setUp()
 {
     parent::setUp();
     $this->object = new \YapepBase\Util\CsvParser();
 }
Пример #14
0
 public function setUp()
 {
     parent::setUp();
     $this->object = new SyslogConnectionMock();
 }
Пример #15
0
 /**
  * Runs after each test
  *
  * @return void
  */
 protected function tearDown()
 {
     parent::tearDown();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->object = new NativeSyslogConnection();
 }
Пример #17
0
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  */
 protected function tearDown()
 {
     parent::tearDown();
     $this->cleanupTestDirectory();
 }
Пример #18
0
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 protected function tearDown()
 {
     Config::getInstance()->clear();
     Application::getInstance()->getDiContainer()->getEventHandlerRegistry()->clearAll();
     parent::tearDown();
 }
Пример #19
0
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     parent::tearDown();
     if (!$this->isRunnable || empty($this->connection)) {
         return;
     }
     $this->connection->query('DROP TABLE IF EXISTS test');
     $this->connection->query('DROP TABLE IF EXISTS test2');
 }
Пример #20
0
 /**
  * Cleans up the environment after running a test.
  */
 protected function tearDown()
 {
     $this->config->clear();
     parent::tearDown();
 }
Пример #21
0
 /**
  * Prepares the environment before running a test.
  */
 protected function setUp()
 {
     parent::setUp();
     $this->request = $this->getRequest();
 }
Пример #22
0
 protected function setUp()
 {
     parent::setUp();
     $this->simpleAutoloader = new SimpleAutoloaderMock();
 }
Пример #23
0
 /**
  * TearDown
  *
  * return void
  */
 protected function tearDown()
 {
     Config::getInstance()->clear();
     parent::tearDown();
 }
 /**
  * Sets up the testing environment for every test.
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->originalErrorReporting = error_reporting(E_ALL | E_STRICT);
 }
Пример #25
0
 public function setUp()
 {
     parent::setUp();
     $this->autoloaderRegistry = new AutoloaderRegistryMock();
 }
Пример #26
0
 public function setUp()
 {
     parent::setUp();
     $this->logger = new LoggerMock();
     $this->errorHandler = new LoggingErrorHandler($this->logger);
 }
Пример #27
0
 /**
  * Tears down the fixture, for example, close a network connection.
  * This method is called after a test is executed.
  *
  * @return void
  */
 protected function tearDown()
 {
     parent::tearDown();
     Application::getInstance()->setDiContainer($this->originalDiContainer);
 }
Пример #28
0
 protected function tearDown()
 {
     parent::tearDown();
     Application::getInstance()->clearI18nTranslator();
 }