Permalink
Browse files

created, modified and updated fields now use static timestamp in test…

…cases
  • Loading branch information...
1 parent dec67ef commit f0bd7386e22e8d0d08b0e146b76f03aa997f3c68 @ceeram ceeram committed Mar 28, 2012
View
@@ -1629,7 +1629,7 @@ public function save($data = null, $validate = true, $fieldList = array()) {
if (!array_key_exists('format', $colType)) {
$time = strtotime('now');
} else {
- $time = $colType['formatter']($colType['format']);
+ $time = call_user_func($colType['formatter'], $colType['format']);
}
if (!empty($this->whitelist)) {
$this->whitelist[] = $updateCol;
@@ -163,7 +163,6 @@ public function testPluginModel() {
), App::RESET);
CakePlugin::load('TestPlugin');
- $ts = date('Y-m-d H:i:s');
$PluginModel = ClassRegistry::init('TestPlugin.TestPluginAuthUser');
$user['id'] = 1;
$user['username'] = 'gwoo';
@@ -185,7 +184,7 @@ public function testPluginModel() {
'username' => 'gwoo',
'created' => '2007-03-17 01:16:23'
);
- $this->assertTrue($result['updated'] >= $ts);
+ $this->assertEquals(self::date(), $result['updated']);
unset($result['updated']);
$this->assertEquals($expected, $result);
CakePlugin::unload();
@@ -1867,7 +1867,6 @@ public function testWithAssociation() {
'doomed' => true
))));
- $ts = date('Y-m-d H:i:s');
$TestModel->save();
$TestModel->hasAndBelongsToMany['SomethingElse']['order'] = 'SomethingElse.id ASC';
@@ -1921,7 +1920,7 @@ public function testWithAssociation() {
)
)
);
- $this->assertTrue($result['Something']['updated'] >= $ts);
+ $this->assertEquals(self::date(), $result['Something']['updated']);
unset($result['Something']['updated']);
$this->assertEquals($expected, $result);
}
Oops, something went wrong.

0 comments on commit f0bd738

Please sign in to comment.