/** * 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); }
/** * 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); }
protected function tearDown() { parent::tearDown(); while (ob_get_level() > $this->originalObLevel) { ob_end_flush(); } }
/** * 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) { } }
public function tearDown() { $_GET = array(); $_POST = array(); $_COOKIE = array(); $_ENV = array(); parent::tearDown(); }
/** * 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(); }
/** * 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(); }
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(); } }
/** * 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)); }
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); } }
/** * 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); }
public function setUp() { parent::setUp(); $this->object = new \YapepBase\Util\CsvParser(); }
public function setUp() { parent::setUp(); $this->object = new SyslogConnectionMock(); }
/** * Runs after each test * * @return void */ protected function tearDown() { parent::tearDown(); }
protected function setUp() { parent::setUp(); $this->object = new NativeSyslogConnection(); }
/** * 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(); }
/** * 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(); }
/** * 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'); }
/** * Cleans up the environment after running a test. */ protected function tearDown() { $this->config->clear(); parent::tearDown(); }
/** * Prepares the environment before running a test. */ protected function setUp() { parent::setUp(); $this->request = $this->getRequest(); }
protected function setUp() { parent::setUp(); $this->simpleAutoloader = new SimpleAutoloaderMock(); }
/** * 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); }
public function setUp() { parent::setUp(); $this->autoloaderRegistry = new AutoloaderRegistryMock(); }
public function setUp() { parent::setUp(); $this->logger = new LoggerMock(); $this->errorHandler = new LoggingErrorHandler($this->logger); }
/** * 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); }
protected function tearDown() { parent::tearDown(); Application::getInstance()->clearI18nTranslator(); }