From bd449f740512ce10de9ac00a9970d6ee80d85ab4 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Sat, 29 Oct 2016 11:17:57 +0530 Subject: [PATCH] Fix tests in Navigation, TableSearchController Signed-off-by: Deven Bansod --- test/classes/controllers/TableSearchControllerTest.php | 2 ++ test/classes/navigation/NavigationTest.php | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/test/classes/controllers/TableSearchControllerTest.php b/test/classes/controllers/TableSearchControllerTest.php index 355d98c109..390b93e488 100644 --- a/test/classes/controllers/TableSearchControllerTest.php +++ b/test/classes/controllers/TableSearchControllerTest.php @@ -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; diff --git a/test/classes/navigation/NavigationTest.php b/test/classes/navigation/NavigationTest.php index aef668e822..72a11090e9 100644 --- a/test/classes/navigation/NavigationTest.php +++ b/test/classes/navigation/NavigationTest.php @@ -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');