ソースを参照

Use more durable assertion.

MySQL has length, SQLite does not :(
mark_story 12 年 前
コミット
277acc1b69
1 ファイル変更4 行追加4 行削除
  1. 4 4
      tests/TestCase/View/Form/EntityContextTest.php

+ 4 - 4
tests/TestCase/View/Form/EntityContextTest.php

@@ -146,10 +146,10 @@ class EntityContextTest extends TestCase {
 		$this->assertFalse($context->hasError('title'));
 		$this->assertFalse($context->hasError('title'));
 		$this->assertEquals('string', $context->type('title'));
 		$this->assertEquals('string', $context->type('title'));
 		$this->assertEquals([], $context->error('title'));
 		$this->assertEquals([], $context->error('title'));
-		$this->assertEquals(
-			['length' => null, 'precision' => null],
-			$context->attributes('title')
-		);
+
+		$attrs = $context->attributes('title');
+		$this->assertArrayHasKey('length', $attrs);
+		$this->assertArrayHasKey('precision', $attrs);
 	}
 	}
 
 
 /**
 /**