protected function tearDown() { try { Reflection::setProperty(Zibo::getInstance(), 'instance', null); } catch (ZiboException $e) { } }
public function testSetContainer() { $container = new DependencyContainer(); Reflection::setProperty($this->di, 'instances', array($this)); $this->di->setContainer($container); $this->assertEquals($container, Reflection::getProperty($this->di, 'container')); $this->assertNull(Reflection::getProperty($this->di, 'instances')); }
public function tearDown() { Reflection::setProperty(Zibo::getInstance(), 'instance', null); if (file_exists('application/config/modules.temp.xml')) { unlink('application/config/modules.temp.xml'); } $this->tearDownApplication(); }
/** * @dataProvider providerGetParent */ public function testGetParent($expected, $value) { $currentFileSystem = FileSystem::getInstance(); $windowsFileSystem = new WindowsFileSystem(); Reflection::setProperty(FileSystem::getInstance(), 'instance', $windowsFileSystem); $file = new File($value); $this->assertEquals(new File($expected), $windowsFileSystem->getParent($file)); Reflection::setProperty(FileSystem::getInstance(), 'instance', $currentFileSystem); }
public function testExecute() { $browser = new GenericBrowser(new File(getcwd())); $this->configIOMock = new ConfigIOMock(); $zibo = Zibo::getInstance($browser, $this->configIOMock); $string = 'This is a test string.' . "\n\n" . 'We would like to have multiple lines.'; $output = System::execute('echo \'' . $string . '\''); $this->assertEquals($string, $output); Reflection::setProperty(Zibo::getInstance(), 'instance', null); }
protected function getConnection($connect = true) { $dsn = Zibo::getInstance()->getConfigValue('database.connection.mysql'); if ($dsn == null) { Reflection::setProperty(Zibo::getInstance(), 'instance', null); $this->markTestSkipped('No dsn found for database.connection.mysql, check config/database.ini'); return; } $this->dsn = new Dsn($dsn); $connection = new MysqlDriver($this->dsn); if ($connect) { $connection->connect(); } return $connection; }
public function tearDown() { Reflection::setProperty(Zibo::getInstance(), 'instance', null); }
public function tearDown() { $this->tearDownApplication(); Reflection::setProperty(ImageFactory::getInstance(), 'instance', null); }
protected function tearDown() { Reflection::setProperty(CaptchaManager::getInstance(), 'instance', null); Reflection::setProperty(Zibo::getInstance(), 'instance', null); }
protected function tearDown() { Reflection::setProperty(ValidationFactory::getInstance(), 'instance', null); Reflection::setProperty(Zibo::getInstance(), 'instance', null); }
public function tearDown() { Reflection::setProperty($this->zibo, 'instance', null); }
protected function tearDown() { Reflection::setProperty(ModelManager::getInstance(), 'instance', null); Reflection::setProperty(DatabaseManager::getInstance(), 'instance', null); Reflection::setProperty(Zibo::getInstance(), 'instance', null); }
/** * @dataProvider providerIsRedirect */ public function testIsRedirect($expected, $responseCode) { $response = new HttpResponse('test'); Reflection::setProperty($response, 'responseCode', $responseCode); $this->assertEquals($expected, $response->isRedirect()); }
public function tearDown() { Reflection::setProperty(Zibo::getInstance(), 'instance', null); unset($this->message); }