コード例 #1
0
ファイル: ConfigTest.php プロジェクト: winkbrace/oracle
 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'));
 }
コード例 #2
0
ファイル: ExecutorTest.php プロジェクト: winkbrace/oracle
 /**
  * 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);
 }
コード例 #3
0
ファイル: _bootstrap.php プロジェクト: winkbrace/oracle
<?php

// Here you can initialize variables that will for your tests
// force logging off
\Oracle\Support\Config::put('logging', false);
コード例 #4
0
ファイル: bootstrap.php プロジェクト: winkbrace/oracle
<?php

use Oracle\Connection;
use Oracle\Support\Config;
// setup QueryLogger implementation
Config::put('logger', new \Oracle\Log\WebQueryLog(new Connection()));
コード例 #5
0
ファイル: WebQueryLogTest.php プロジェクト: winkbrace/oracle
 public function tearDown()
 {
     Config::put('logging', false);
     unset($this->logger);
 }
コード例 #6
0
ファイル: StatementTest.php プロジェクト: winkbrace/oracle
 /**
  * @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');
 }