diff --git a/codeception.yml b/codeception.yml index 987d66892..4361c1022 100644 --- a/codeception.yml +++ b/codeception.yml @@ -6,6 +6,7 @@ paths: envs: tests/_envs actor_suffix: Tester settings: + shuffle: true bootstrap: _bootstrap.php coverage: enabled: true diff --git a/e107 b/e107 index f5f2212b5..a8d1541b9 160000 --- a/e107 +++ b/e107 @@ -1 +1 @@ -Subproject commit f5f2212b54af8c0c82b464891bee93cc1c2e0b29 +Subproject commit a8d1541b9d059437d7a98cf1c3b652b879ebb7ca diff --git a/tests/unit/e107pluginTest.php b/tests/unit/e107pluginTest.php index 42b2b8051..6118db09b 100644 --- a/tests/unit/e107pluginTest.php +++ b/tests/unit/e107pluginTest.php @@ -356,6 +356,12 @@ unset($actual[$unimportant_key]); } + // Filter out cruft from e_LEGACY_MODE database output + foreach ($actual as $key => $value) + { + if (is_int($key)) unset($actual[$key]); + } + $this->assertEquals($expected,$actual); $status = $this->ep->XmlSiteLinks('uninstall',$plugVars); diff --git a/tests/unit/e_db_mysqlTest.php b/tests/unit/e_db_mysqlTest.php index 53f3234c0..77161ace3 100644 --- a/tests/unit/e_db_mysqlTest.php +++ b/tests/unit/e_db_mysqlTest.php @@ -28,6 +28,7 @@ $this->fail("Couldn't load e_db_mysql object"); } + define('e_LEGACY_MODE', true); $this->db->__construct(); $this->loadConfig(); @@ -184,7 +185,8 @@ 'dblog_user_id' => '1', ); - $this->assertEquals($data, $expected); + + $this->assertEquals($expected, $data); } @@ -304,8 +306,10 @@ ); $this->db->insert('generic', $insert); - $actual = $this->db->lastInsertId(); - $this->assertEquals(2,$actual); + $first = $this->db->lastInsertId(); + $this->db->insert('generic', $insert); + $next = $this->db->lastInsertId(); + $this->assertEquals(1, $next - $first); } @@ -500,7 +504,6 @@ $check = (strpos($row[1], "CREATE TABLE `e107_user`") !== false); $this->assertTrue($check); /* - define('e_LEGACY_MODE', true); $this->db->select('user', '*', 'user_id = 1'); $row = $this->db->db_Fetch(); $this->assertEquals("e107", $row['user_name']); @@ -770,8 +773,13 @@ public function testDb_CopyRow() { - $result = $this->db->db_CopyRow('news', '*', "news_id = 1"); - $this->assertGreaterThan(1,$result); + $count_args = ['news', '(*)', '']; + $copy_args = ['news', '*', 'news_id = 1']; + + $initial_count = $this->db->count(...$count_args); + $this->db->db_CopyRow(...$copy_args); + $next_count = $this->db->count(...$count_args); + $this->assertEquals(1, $next_count - $initial_count); } public function testDb_CopyTable() @@ -937,6 +945,7 @@ } + $this->assertEquals('test_id', $res[0], print_r($res,true)); if(!$tabs = $xql->tables()) diff --git a/tests/unit/e_db_pdoTest.php b/tests/unit/e_db_pdoTest.php index e3f17581d..fb405b4cc 100644 --- a/tests/unit/e_db_pdoTest.php +++ b/tests/unit/e_db_pdoTest.php @@ -30,7 +30,7 @@ $this->fail("Couldn't load e_db_pdo object"); } - + define('e_LEGACY_MODE', true); $this->db->__construct(); $this->loadConfig(); @@ -527,7 +527,6 @@ $check = (strpos($row[1], "CREATE TABLE `e107_user`") !== false); $this->assertTrue($check); - define('e_LEGACY_MODE', true); $this->db->select('user', '*', 'user_id = 1'); $row = $this->db->db_Fetch(); $this->assertEquals("e107", $row['user_name']);