From: Philipp Holzer Date: Tue, 30 Oct 2018 11:47:44 +0000 (+0100) Subject: Mocking DBStructure::existsTable() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=91f595000c625a80f3987bb8087bff936e35ace1;p=friendica.git Mocking DBStructure::existsTable() --- diff --git a/tests/src/Core/Console/AutomaticInstallationConsoleTest.php b/tests/src/Core/Console/AutomaticInstallationConsoleTest.php index 03a05b09b0..4e1f269dcd 100644 --- a/tests/src/Core/Console/AutomaticInstallationConsoleTest.php +++ b/tests/src/Core/Console/AutomaticInstallationConsoleTest.php @@ -31,6 +31,14 @@ class AutomaticInstallationConsoleTest extends ConsoleTest $this->db_data = getenv('MYSQL_DATABASE'); $this->db_user = getenv('MYSQL_USERNAME') . getenv('MYSQL_USER'); $this->db_pass = getenv('MYSQL_PASSWORD'); + + // Mocking 'DBStructure::existsTable()' because with CI, we cannot create an empty database + // therefore we temporary override the existing database + /// @todo Mocking the DB-Calls of ConsoleTest so we don't need this specific mock anymore + $existsMock = \Mockery::mock('alias:Friendica\Database\DBStructure'); + $existsMock->shouldReceive('existsTable') + ->with('user') + ->andReturn(false); } private function assertConfig($family, $key, $value)