From 97f02eaf2b5fbdb7cf23ffefd3487efcbd50ec27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 20 Dec 2017 18:51:05 -0200 Subject: [PATCH] Fix TableRelationControllerTest dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- .../Table/TableRelationControllerTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/classes/Controllers/Table/TableRelationControllerTest.php b/test/classes/Controllers/Table/TableRelationControllerTest.php index ee8c10b858..bea6c91deb 100644 --- a/test/classes/Controllers/Table/TableRelationControllerTest.php +++ b/test/classes/Controllers/Table/TableRelationControllerTest.php @@ -33,6 +33,7 @@ class TableRelationControllerTest extends PmaTestCase $GLOBALS['server'] = 0; $GLOBALS['db'] = 'db'; $GLOBALS['table'] = 'table'; + $GLOBALS['PMA_PHP_SELF'] = 'index.php'; //$_SESSION $_REQUEST['foreignDb'] = 'db'; @@ -41,9 +42,28 @@ class TableRelationControllerTest extends PmaTestCase $GLOBALS['dblist'] = new DataBasePMAMockForTblRelation(); $GLOBALS['dblist']->databases = new DataBaseMockForTblRelation(); + $indexes = array( + array( + 'Schema' => 'Schema1', + 'Key_name' => 'Key_name1', + 'Column_name' => 'Column_name1', + ), + array( + 'Schema' => 'Schema2', + 'Key_name' => 'Key_name2', + 'Column_name' => 'Column_name2', + ), + array( + 'Schema' => 'Schema3', + 'Key_name' => 'Key_name3', + 'Column_name' => 'Column_name3', + ), + ); $dbi = $this->getMockBuilder('PhpMyAdmin\DatabaseInterface') ->disableOriginalConstructor() ->getMock(); + $dbi->expects($this->any())->method('getTableIndexes') + ->will($this->returnValue($indexes)); $GLOBALS['dbi'] = $dbi;