Browse Source

Unify assert method argument order.

euromark 11 years ago
parent
commit
fa987c7843

+ 1 - 1
tests/TestCase/Controller/Component/CookieComponentTest.php

@@ -389,7 +389,7 @@ class CookieComponentTest extends TestCase {
 		$result = $this->Controller->response->cookie('Testing');
 
 		$time = new Time('now');
-		$this->assertWithinMargin($result['expire'], $time->format('U') + 10, 1);
+		$this->assertWithinRange($time->format('U') + 10, $result['expire'], 1);
 		unset($result['expire']);
 		$this->assertEquals($expected, $result);
 	}

+ 2 - 2
tests/TestCase/Database/QueryTest.php

@@ -2297,7 +2297,7 @@ class QueryTest extends TestCase {
 			->select(['d' => $query->func()->now('time')])
 			->execute();
 
-		$this->assertWithinMargin(
+		$this->assertWithinRange(
 			date('U'),
 			(new \DateTime($result->fetchAll('assoc')[0]['d']))->format('U'),
 			1
@@ -2307,7 +2307,7 @@ class QueryTest extends TestCase {
 		$result = $query
 			->select(['d' => $query->func()->now()])
 			->execute();
-		$this->assertWithinMargin(
+		$this->assertWithinRange(
 			date('U'),
 			(new \DateTime($result->fetchAll('assoc')[0]['d']))->format('U'),
 			1

+ 1 - 1
tests/TestCase/Network/Session/DatabaseSessionTest.php

@@ -100,7 +100,7 @@ class DatabaseSessionTest extends TestCase {
 		$this->assertEquals($expected, $result);
 
 		$expected = time() + ini_get('session.gc_maxlifetime');
-		$this->assertWithinMargin($expires, $expected, 1);
+		$this->assertWithinRange($expected, $expires, 1);
 	}
 
 /**

+ 3 - 3
tests/TestCase/Utility/FileTest.php

@@ -365,7 +365,7 @@ class FileTest extends TestCase {
 		$someFile = new File(TMP . 'some_file.txt', false);
 		$this->assertFalse($someFile->lastAccess());
 		$this->assertTrue($someFile->open());
-		$this->assertWithinMargin($someFile->lastAccess(), time(), 2);
+		$this->assertWithinRange(time(), $someFile->lastAccess(), 2);
 		$someFile->close();
 		$someFile->delete();
 	}
@@ -379,10 +379,10 @@ class FileTest extends TestCase {
 		$someFile = new File(TMP . 'some_file.txt', false);
 		$this->assertFalse($someFile->lastChange());
 		$this->assertTrue($someFile->open('r+'));
-		$this->assertWithinMargin($someFile->lastChange(), time(), 2);
+		$this->assertWithinRange(time(), $someFile->lastChange(), 2);
 
 		$someFile->write('something');
-		$this->assertWithinMargin($someFile->lastChange(), time(), 2);
+		$this->assertWithinRange(time(), $someFile->lastChange(), 2);
 
 		$someFile->close();
 		$someFile->delete();