protected function tearDown() { Config::revertProperty("global", "prefix_system"); if (Files::exists($this->path)) { unlink($this->path); } parent::tearDown(); }
/** * @test */ public function shouldThrowConnectionExceptionFromForPostgres() { //given Config::overrideProperty('sql_dialect')->with('\\Ouzo\\Db\\Dialect\\PostgresDialect'); Mock::when($this->pdoMock)->errorInfo()->thenReturn(array('57P01', 7, 'Execution error')); $executor = StatementExecutor::prepare($this->dbMock, 'SELECT 1', array(), array()); //when CatchException::when($executor)->execute(); //then CatchException::assertThat()->isInstanceOf('\\Ouzo\\DbConnectionException'); Config::revertProperty('sql_dialect'); }
public function tearDown() { parent::tearDown(); Config::revertProperty('path', 'view'); }
/** * @test * @expectedException \InvalidArgumentException */ public function revertOnNonExistingKeyShouldThrowException() { Config::revertProperty('key', 'does', 'not', 'exist'); }
/** * @test */ public function shouldThrowExceptionWhenDialectAdapterNotExists() { //given Config::overrideProperty('sql_dialect')->with('\\Ouzo\\Tools\\Model\\Template\\MyImagineDialect'); //when try { new Generator('order_products'); $this->fail(); } catch (GeneratorException $e) { } //then Config::revertProperty('sql_dialect'); }
protected function tearDown() { parent::tearDown(); Config::revertProperty('sql_dialect'); }
/** * @test */ public function shouldRemoveNoticeIfFullUrlMatches() { //given Config::overrideProperty('global', 'prefix_system')->with('prefix'); Route::allowAll('/simple_test', 'simple_test'); $this->get('/simple_test/add_notice_for_full_url'); //when $this->get('/simple_test/read_kept'); $this->get('/simple_test/read_kept'); //then $this->assertRenderedContent()->isNull(); Config::revertProperty('global', 'prefix_system'); }