ソースを参照

Update test to be platform independet

Ladislav Gallay 11 年 前
コミット
5780217f50
1 ファイル変更4 行追加15 行削除
  1. 4 15
      tests/TestCase/ORM/QueryTest.php

+ 4 - 15
tests/TestCase/ORM/QueryTest.php

@@ -2074,30 +2074,19 @@ class QueryTest extends TestCase {
 	}
 	
 /**
- * Test count with autoFields
+ * Test that autofields works with count()
  *
  * @return void
  */
 	public function testAutoFieldsCount() {
 		$table = TableRegistry::get('Articles');
-		$table->belongsTo('Authors');
-
-		$resultNormal = $table->find()
-			->select(['myField' => '(SELECT RAND())'])
-			->hydrate(false)
-			->contain('Authors')
-			->count();
 
-		$resultAutoFields = $table->find()
-			->select(['myField' => '(SELECT RAND())'])
+		$result = $table->find()
+			->select(['myField' => '(SELECT (2 + 2))'])
 			->autoFields(true)
-			->hydrate(false)
-			->contain('Authors')
 			->count();
 
-		$this->assertNotNull($resultNormal);
-		$this->assertNotNull($resultAutoFields);
-		$this->assertEquals($resultNormal, $resultAutoFields);
+		$this->assertEquals(3, $result);
 	}
 
 }