/** * Connection class constructor. * * @throws \InvalidArgumentException */ public function __construct() { $this->app = App::getInstance(); $this->dbConfig = $this->getDatabaseConfig(); if (empty($this->dbConfig)) { throw new \InvalidArgumentException('Database configuration is empty!'); } }
public function testGetInstance() { $this->assertEquals(App::getInstance(), $this->app); }
/** * Command class constructor. * Instantiate connection class. */ public function __construct() { if (!$this->app instanceof App) { $this->app = App::getInstance(); } // create connection class instance if does not exist if (!$this->connection instanceof Connection) { $this->connection = new Connection($this->app); } }