Redaxscript\Db::construct PHP Method

construct() public static method

constructor of the class
Since: 2.6.0
public static construct ( Config $config )
$config Config instance of the config class
    public static function construct(Config $config)
    {
        self::$_config = $config;
    }

Usage Example

Example #1
0
 /**
  * testInit
  *
  * @since 2.2.0
  *
  * @param string $dbType
  *
  * @dataProvider providerInit
  */
 public function testInit($dbType = null)
 {
     /* setup */
     $this->_config->set('dbType', $dbType);
     Db::construct($this->_config);
     Db::init();
     /* actual */
     $actual = Db::getDb();
     /* compare */
     $this->assertInstanceOf('PDO', $actual);
 }