Browse Source

Fix broken tests.

mscherer 5 years ago
parent
commit
306a940e79
3 changed files with 9 additions and 16 deletions
  1. 5 1
      src/Model/Table/Table.php
  2. 2 2
      src/Utility/L10n.php
  3. 2 13
      tests/TestCase/Model/Table/TableTest.php

+ 5 - 1
src/Model/Table/Table.php

@@ -79,7 +79,11 @@ class Table extends ShimTable {
 	 * Return the next auto increment id from the current table
 	 * UUIDs will return false
 	 *
-	 * @return int|bool next auto increment value or False on failure
+	 * Only for MySQL.
+	 *
+	 * @deprecated Seems broken since 4.1.2+.
+	 *
+	 * @return int|false next auto increment value or False on failure
 	 */
 	public function getNextAutoIncrement() {
 		$query = "SHOW TABLE STATUS WHERE name = '" . $this->getAlias() . "'";

+ 2 - 2
src/Utility/L10n.php

@@ -271,7 +271,7 @@ class L10n {
 	 * Attempts to find locale for language, or language for locale
 	 *
 	 * @param string|array|null $mixed 2/3 char string (language/locale), array of those strings, or null
-	 * @return string|array|bool string language/locale, array of those values, whole map as an array,
+	 * @return string|array|false string language/locale, array of those values, whole map as an array,
 	 *    or false when language/locale doesn't exist
 	 */
 	public function map($mixed = null) {
@@ -304,7 +304,7 @@ class L10n {
 	 * Attempts to find catalog record for requested language
 	 *
 	 * @param string|array|null $language String requested language, array of requested languages, or null for whole catalog
-	 * @return array|bool array catalog record for requested language, array of catalog records, whole catalog,
+	 * @return array|false array catalog record for requested language, array of catalog records, whole catalog,
 	 *    or false when language doesn't exist
 	 */
 	public function catalog($language = null) {

+ 2 - 13
tests/TestCase/Model/Table/TableTest.php

@@ -58,22 +58,11 @@ class TableTest extends TestCase {
 	 */
 	public function testTruncate() {
 		$is = $this->Users->find()->count();
-		$this->assertEquals(4, $is);
-
-		$config = ConnectionManager::getConfig('test');
-		if ((strpos($config['driver'], 'Mysql') !== false)) {
-			$is = $this->Users->getNextAutoIncrement();
-			$this->assertEquals(5, $is);
-		}
+		$this->assertSame(4, $is);
 
 		$this->Users->truncate();
 		$is = $this->Users->find()->count();
-		$this->assertEquals(0, $is);
-
-		if ((strpos($config['driver'], 'Mysql') !== false)) {
-			$is = $this->Users->getNextAutoIncrement();
-			$this->assertEquals(1, $is);
-		}
+		$this->assertSame(0, $is);
 	}
 
 	/**