Fix tests in Navigation, TableSearchController

Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
This commit is contained in:
Deven Bansod 2016-10-29 11:17:57 +05:30
parent d5c9a193f4
commit bd449f7405
2 changed files with 11 additions and 0 deletions

View File

@ -85,6 +85,8 @@ class TableSearchControllerTest extends PMATestCase
$dbi->expects($this->any())->method('fetchValue')
->will($this->returnValue($show_create_table));
$dbi->expects($this->any())->method('escapeString')
->will($this->returnArgument(0));
$GLOBALS['dbi'] = $dbi;

View File

@ -72,6 +72,9 @@ class NavigationTest extends PMATestCase
$dbi->expects($this->once())
->method('tryQuery')
->with($expectedQuery);
$dbi->expects($this->any())->method('escapeString')
->will($this->returnArgument(0));
$GLOBALS['dbi'] = $dbi;
$this->object->hideNavigationItem('itemName', 'itemType', 'db');
}
@ -93,6 +96,9 @@ class NavigationTest extends PMATestCase
$dbi->expects($this->once())
->method('tryQuery')
->with($expectedQuery);
$dbi->expects($this->any())->method('escapeString')
->will($this->returnArgument(0));
$GLOBALS['dbi'] = $dbi;
$this->object->unhideNavigationItem('itemName', 'itemType', 'db');
}
@ -111,6 +117,8 @@ class NavigationTest extends PMATestCase
$dbi = $this->getMockBuilder('PMA\libraries\DatabaseInterface')
->disableOriginalConstructor()
->getMock();
$dbi->expects($this->any())->method('escapeString')
->will($this->returnArgument(0));
$dbi->expects($this->once())
->method('tryQuery')
->with($expectedQuery)
@ -140,6 +148,7 @@ class NavigationTest extends PMATestCase
->will($this->returnValue(false));
$dbi->expects($this->once())
->method('freeResult');
$GLOBALS['dbi'] = $dbi;
$html = $this->object->getItemUnhideDialog('db');