diff --git a/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php b/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php index 42b71f56243..ac0dc978c71 100644 --- a/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php +++ b/lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php @@ -63,6 +63,7 @@ public function setUp() { */ protected function _checkConfigs() { $config = ConnectionManager::enumConnectionObjects(); + $this->skipIf($this->db instanceof Sqlite, 'This test is not compatible with Sqlite.'); $this->skipIf( !isset($config['test']) || !isset($config['test2']), 'Primary and secondary test databases not configured, skipping cross-database join tests.' @@ -95,7 +96,6 @@ public function testModelDatasources() { */ public function testHabtmFind() { $this->loadFixtures('Player', 'Guild', 'GuildsPlayer'); - $Player = ClassRegistry::init('Player'); $players = $Player->find('all', array( @@ -130,7 +130,6 @@ public function testHabtmFind() { */ public function testHabtmSave() { $this->loadFixtures('Player', 'Guild', 'GuildsPlayer'); - $Player = ClassRegistry::init('Player'); $players = $Player->find('count'); $this->assertEquals(4, $players); diff --git a/lib/Cake/Test/Case/Model/ModelDeleteTest.php b/lib/Cake/Test/Case/Model/ModelDeleteTest.php index 942526ff95e..e478035e4bf 100644 --- a/lib/Cake/Test/Case/Model/ModelDeleteTest.php +++ b/lib/Cake/Test/Case/Model/ModelDeleteTest.php @@ -316,7 +316,8 @@ public function testDeleteAll() { $TestModel->recursive = -1; $result = $TestModel->find('all', array( - 'fields' => array('id', 'user_id', 'title', 'published') + 'fields' => array('id', 'user_id', 'title', 'published'), + 'order' => array('Article.id' => 'ASC') )); $expected = array( @@ -363,7 +364,8 @@ public function testDeleteAll() { $TestModel->recursive = -1; $result = $TestModel->find('all', array( - 'fields' => array('id', 'user_id', 'title', 'published') + 'fields' => array('id', 'user_id', 'title', 'published'), + 'order' => array('Article.id' => 'ASC') )); $expected = array( array('Article' => array( @@ -398,7 +400,8 @@ public function testDeleteAll() { $TestModel->recursive = -1; $result = $TestModel->find('all', array( - 'fields' => array('id', 'user_id', 'title', 'published') + 'fields' => array('id', 'user_id', 'title', 'published'), + 'order' => array('Article.id' => 'ASC') )); $expected = array( array('Article' => array( @@ -559,7 +562,7 @@ public function testDeleteDependent() { 'ArticlesTag', 'Comment', 'User', 'Attachment' ); $Bidding = new Bidding(); - $result = $Bidding->find('all'); + $result = $Bidding->find('all', array('order' => array('Bidding.id' => 'ASC'))); $expected = array( array( 'Bidding' => array('id' => 1, 'bid' => 'One', 'name' => 'Bid 1'), @@ -581,7 +584,7 @@ public function testDeleteDependent() { $this->assertEquals($expected, $result); $Bidding->delete(4, true); - $result = $Bidding->find('all'); + $result = $Bidding->find('all', array('order' => array('Bidding.id' => 'ASC'))); $expected = array( array( 'Bidding' => array('id' => 1, 'bid' => 'One', 'name' => 'Bid 1'), @@ -599,7 +602,7 @@ public function testDeleteDependent() { $this->assertEquals($expected, $result); $Bidding->delete(2, true); - $result = $Bidding->find('all'); + $result = $Bidding->find('all', array('order' => array('Bidding.id' => 'ASC'))); $expected = array( array( 'Bidding' => array('id' => 1, 'bid' => 'One', 'name' => 'Bid 1'), diff --git a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php index d209eb0056b..cbedee271de 100644 --- a/lib/Cake/Test/Case/Model/ModelIntegrationTest.php +++ b/lib/Cake/Test/Case/Model/ModelIntegrationTest.php @@ -717,6 +717,7 @@ public function testHABTMKeepExisting() { */ public function testHABTMKeepExistingWithThreeDbs() { $config = ConnectionManager::enumConnectionObjects(); + $this->skipIf($this->db instanceof Sqlite, 'This test is not compatible with Sqlite.'); $this->skipIf( !isset($config['test']) || !isset($config['test2']) || !isset($config['test_database_three']), 'Primary, secondary, and tertiary test databases not configured, skipping test. To run this test define $test, $test2, and $test_database_three in your database configuration.' @@ -835,7 +836,7 @@ public static function timeProvider() { array('hour' => '', 'min' => '', 'sec' => ''), '' ), - // set and empty merdian + // set and empty merdian array( array('hour' => '1', 'min' => '00', 'meridian' => ''), '' diff --git a/lib/Cake/Test/Case/Model/ModelWriteTest.php b/lib/Cake/Test/Case/Model/ModelWriteTest.php index 5e896795dee..631342ee64b 100644 --- a/lib/Cake/Test/Case/Model/ModelWriteTest.php +++ b/lib/Cake/Test/Case/Model/ModelWriteTest.php @@ -1006,7 +1006,10 @@ public function testSaveWithSet() { $this->assertEquals($expected, $result); $TestModel->recursive = -1; - $result = $TestModel->find('all', array('fields' => array('id', 'title'))); + $result = $TestModel->find('all', array( + 'fields' => array('id', 'title'), + 'order' => array('Article.id' => 'ASC') + )); $expected = array( array('Article' => array('id' => 1, 'title' => 'First Article')), array('Article' => array('id' => 2, 'title' => 'Second Article')), @@ -3075,7 +3078,8 @@ public function testSaveAllDeepAssociated() { 'First new comment', 'Second new comment' ); - $this->assertEquals($expected, Set::extract($result['Comment'], '{n}.comment')); + $result = Set::extract(Set::sort($result['Comment'], '{n}.id', 'ASC'), '{n}.comment'); + $this->assertEquals($expected, $result); $result = $TestModel->Comment->User->field('id', array('user' => 'newuser', 'password' => 'newuserpass')); $this->assertEquals(5, $result); @@ -3097,7 +3101,8 @@ public function testSaveAllDeepAssociated() { 'Third new comment', 'Fourth new comment' ); - $this->assertEquals($expected, Set::extract($result['Comment'], '{n}.comment')); + $result = Set::extract(Set::sort($result['Comment'], '{n}.id', 'ASC'), '{n}.comment'); + $this->assertEquals($expected, $result); $result = $TestModel->Comment->Attachment->field('id', array('attachment' => 'deepsaved')); $this->assertEquals(2, $result); @@ -3848,7 +3853,8 @@ public function testSaveAllHasMany() { 'First new comment', 'Second new comment' ); - $this->assertEquals(Set::extract($result['Comment'], '{n}.comment'), $expected); + $result = Set::extract(Set::sort($result['Comment'], '{n}.id', 'ASC'), '{n}.comment'); + $this->assertEquals($expected, $result); $result = $TestModel->saveAll( array( @@ -3871,7 +3877,8 @@ public function testSaveAllHasMany() { 'Second new comment', 'Third new comment' ); - $this->assertEquals(Set::extract($result['Comment'], '{n}.comment'), $expected); + $result = Set::extract(Set::sort($result['Comment'], '{n}.id', 'ASC'), '{n}.comment'); + $this->assertEquals($expected, $result); $TestModel->beforeSaveReturn = false; $result = $TestModel->saveAll( @@ -3895,7 +3902,8 @@ public function testSaveAllHasMany() { 'Second new comment', 'Third new comment' ); - $this->assertEquals(Set::extract($result['Comment'], '{n}.comment'), $expected); + $result = Set::extract(Set::sort($result['Comment'], '{n}.id', 'ASC'), '{n}.comment'); + $this->assertEquals($expected, $result); } /** diff --git a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php index 9d170fdb4b3..72fe704c85c 100644 --- a/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/DebugTransportTest.php @@ -50,7 +50,7 @@ public function testSend() { $email->messageID('<4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>'); $email->subject('Testing Message'); $date = date(DATE_RFC2822); - $email->setHeaders(array('X-Mailer' => $email::EMAIL_CLIENT, 'Date' => $date)); + $email->setHeaders(array('X-Mailer' => DebugCakeEmail::EMAIL_CLIENT, 'Date' => $date)); $email->expects($this->any())->method('message')->will($this->returnValue(array('First Line', 'Second Line', ''))); $headers = "From: CakePHP Test \r\n"; diff --git a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php index c6d58444b4c..6b1ecaadff9 100644 --- a/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/Test/Case/Network/Email/SmtpTransportTest.php @@ -221,7 +221,7 @@ public function testSendData() { $email->messageID('<4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>'); $email->subject('Testing SMTP'); $date = date(DATE_RFC2822); - $email->setHeaders(array('X-Mailer' => $email::EMAIL_CLIENT, 'Date' => $date)); + $email->setHeaders(array('X-Mailer' => SmtpCakeEmail::EMAIL_CLIENT, 'Date' => $date)); $email->expects($this->any())->method('message')->will($this->returnValue(array('First Line', 'Second Line', ''))); $data = "From: CakePHP Test \r\n";