/** * 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 }
function setUp() { Pipe\Config::destroy(); Pipe\Connection::destroy(); }
function testInitialiseWithStringNotClosure() { Pipe::initialise(DSN); $dsn = Pipe\Config::instance()->connection(); $this->assertIdentical($dsn, DSN); }
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); }