revertProperty() public static method

public static revertProperty ( ) : void
return void
 protected function tearDown()
 {
     Config::revertProperty("global", "prefix_system");
     if (Files::exists($this->path)) {
         unlink($this->path);
     }
     parent::tearDown();
 }
示例#2
0
 /**
  * @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');
 }
示例#3
0
 public function tearDown()
 {
     parent::tearDown();
     Config::revertProperty('path', 'view');
 }
示例#4
0
 /**
  * @test
  * @expectedException \InvalidArgumentException
  */
 public function revertOnNonExistingKeyShouldThrowException()
 {
     Config::revertProperty('key', 'does', 'not', 'exist');
 }
示例#5
0
 /**
  * @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');
 }
示例#6
0
 protected function tearDown()
 {
     parent::tearDown();
     Config::revertProperty('sql_dialect');
 }
示例#7
0
 /**
  * @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');
 }