Fixing SQL errors when running model_behavior tests with postgresql. Fixes #406

This commit is contained in:
Mark Story 2010-03-07 19:02:19 -05:00
parent bfbf31e234
commit e6664f0ea4

View file

@ -786,16 +786,16 @@ class BehaviorTest extends CakeTestCase {
'Apple' => array('id' => 3), 'Apple' => array('id' => 3),
'Parent' => array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17')) 'Parent' => array('id' => 2,'name' => 'Bright Red Apple', 'mytime' => '22:57:17'))
); );
$result = $Apple->find('all', array('fields' => array('Apple.id', 'Parent.*'), 'conditions' => array('Apple.id <' => '4'))); $result = $Apple->find('all', array(
//$this->assertEqual($result, $expected2); 'fields' => array('Apple.id', 'Parent.id', 'Parent.name', 'Parent.mytime'),
'conditions' => array('Apple.id <' => '4')
));
$this->assertEqual($result, $expected2);
$Apple->Parent->Behaviors->disable('Test'); $Apple->Parent->Behaviors->disable('Test');
$result = $Apple->find('all'); $result = $Apple->find('all');
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$Apple->Parent->Behaviors->attach('Test', array('before' => 'off', 'after' => 'on'));
//$this->assertIdentical($Apple->find('all'), array());
$Apple->Parent->Behaviors->attach('Test', array('after' => 'off')); $Apple->Parent->Behaviors->attach('Test', array('after' => 'off'));
$this->assertEqual($Apple->find('all'), $expected); $this->assertEqual($Apple->find('all'), $expected);