public function testPut() { $config = Config::all(); $this->assertArrayNotHasKey('foo', $config); Config::put('foo', 'bar'); $config = Config::all(); $this->assertArrayHasKey('foo', $config); $this->assertEquals('bar', Config::get('foo')); }
/** * test that the query will still execute when logging is enabled * Testing of the Logger is done elsewhere */ public function testLogging() { \Oracle\Support\Config::put('logging', true); require_once realpath(__DIR__ . '/../../bootstrap.php'); // creates Logger and puts it in Config $executor = new Executor($this->statement); // logger gets attached on construction $executor->execute(); $this->assertTrue($executor->isExecuted()); \Oracle\Support\Config::put('logging', false); }
<?php // Here you can initialize variables that will for your tests // force logging off \Oracle\Support\Config::put('logging', false);
<?php use Oracle\Connection; use Oracle\Support\Config; // setup QueryLogger implementation Config::put('logger', new \Oracle\Log\WebQueryLog(new Connection()));
public function tearDown() { Config::put('logging', false); unset($this->logger); }
/** * @expectedException \Oracle\OracleException */ public function testAutomaticallyValidateSql() { Config::put('validate_sql_syntax', true); new Statement("not a query", $this->connection); $this->fail('Invalid sql syntax should throw OracleException'); }