NodeTest::testGetPresenceWithDisabledIS PHP Метод

testGetPresenceWithDisabledIS() публичный Метод

Tests the getPresence method when DisableIS is true
public testGetPresenceWithDisabledIS ( ) : void
Результат void
    public function testGetPresenceWithDisabledIS()
    {
        $GLOBALS['cfg']['Server']['DisableIS'] = true;
        $GLOBALS['dbs_to_test'] = false;
        $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
        $node = NodeFactory::getInstance();
        // test with no search clause
        $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
        $dbi->expects($this->once())->method('tryQuery')->with("SHOW DATABASES WHERE TRUE ");
        $dbi->expects($this->any())->method('escapeString')->will($this->returnArgument(0));
        $GLOBALS['dbi'] = $dbi;
        $node->getPresence();
        // test with a search clause
        $dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
        $dbi->expects($this->once())->method('tryQuery')->with("SHOW DATABASES WHERE TRUE AND `Database` LIKE '%dbname%' ");
        $dbi->expects($this->any())->method('escapeString')->will($this->returnArgument(0));
        $GLOBALS['dbi'] = $dbi;
        $node->getPresence('', 'dbname');
    }