DbQbeTest::setUp PHP Method

setUp() protected method

This method is called before a test is executed.
protected setUp ( ) : void
return void
    protected function setUp()
    {
        $this->object = new DbQbe('pma_test');
        $GLOBALS['server'] = 0;
        $GLOBALS['db'] = 'pma_test';
        //mock DBI
        $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
        $create_table = 'CREATE TABLE `table1` (' . '`id` int(11) NOT NULL,' . '`value` int(11) NOT NULL,' . 'PRIMARY KEY (`id`,`value`),' . 'KEY `value` (`value`)' . ') ENGINE=InnoDB DEFAULT CHARSET=latin1';
        $dbi->expects($this->any())->method('fetchValue')->with('SHOW CREATE TABLE `pma_test`.`table1`', 0, 1)->will($this->returnValue($create_table));
        $dbi->expects($this->any())->method('getTableIndexes')->will($this->returnValue(array()));
        $GLOBALS['dbi'] = $dbi;
    }