Пример #1
0
 /**
  * Initialise Pipe. Sets config and connection to database
  *
  * @param Closure $config Anonymous function with a single parameter which an instance of Pipe\Config is passed.
  * @return void
  */
 public static function initialise($config)
 {
     Pipe\Config::initialise($config);
     //Set config
     Pipe\Connection::initialise();
     //Setup connection to DB
 }
Пример #2
0
 function setUp()
 {
     Pipe\Config::destroy();
     Pipe\Connection::destroy();
 }
Пример #3
0
 function testInitialiseWithStringNotClosure()
 {
     Pipe::initialise(DSN);
     $dsn = Pipe\Config::instance()->connection();
     $this->assertIdentical($dsn, DSN);
 }
Пример #4
0
 function testEnvironment()
 {
     $instance = Pipe\Config::instance();
     $this->assertTrue($instance->environment() === 0 || $instance->environment() === 1);
     $this->assertTrue($instance->environment() === Pipe\Config::DEVELOPMENT || $instance->environment() === Pipe\Config::PRODUCTION);
 }