浏览代码

Fix tests.

mscherer 6 年之前
父节点
当前提交
6fca3127ba

+ 2 - 2
tests/TestCase/Model/Behavior/SluggedBehaviorTest.php

@@ -266,10 +266,10 @@ class SluggedBehaviorTest extends TestCase {
 	 */
 	public function testLengthRestrictionNoLimit() {
 		$this->articles->behaviors()->Slugged->setConfig(['length' => 0, 'label' => 'long_title', 'field' => 'long_slug']);
-		$entity = $this->_getEntity(str_repeat('foo bar ', 100), 'long_title');
+		$entity = $this->_getEntity(str_repeat('foo bar ', 18), 'long_title');
 
 		$result = $this->articles->save($entity);
-		$this->assertEquals(799, strlen($result->get('long_slug')));
+		$this->assertEquals(143, strlen($result->get('long_slug')));
 	}
 
 	/**

+ 1 - 1
tests/TestCase/View/Helper/TimeHelperTest.php

@@ -62,7 +62,7 @@ class TimeHelperTest extends TestCase {
 	 */
 	public function testTimeAgoInWords() {
 		$res = $this->Time->timeAgoInWords(date(FORMAT_DB_DATETIME, time() - 4 * DAY - 5 * HOUR));
-		$this->assertSame('4 day, 5 hour ago', $res);
+		$this->assertSame('4 days, 5 hours ago', $res);
 	}
 
 	/**