From ef8603e1a7c8584914e39001b8926d1b263f0e80 Mon Sep 17 00:00:00 2001 From: Christian Winther Date: Tue, 28 May 2013 12:02:58 +0000 Subject: [PATCH] Add unit test --- lib/Cake/Test/Case/Model/ModelReadTest.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/Cake/Test/Case/Model/ModelReadTest.php b/lib/Cake/Test/Case/Model/ModelReadTest.php index b3c1dd5ec..c365a0757 100644 --- a/lib/Cake/Test/Case/Model/ModelReadTest.php +++ b/lib/Cake/Test/Case/Model/ModelReadTest.php @@ -7943,6 +7943,27 @@ class ModelReadTest extends BaseModelTest { $this->assertTrue(is_array($result) && !empty($result)); } +/** + * test to assert that != in key together with a single element array will work + * + * @return void + */ + public function testNotEqualsInArrayWithOneValue() { + $this->loadFixtures('Article'); + $Article = new Article(); + $Article->recursive = -1; + + $result = $Article->find( + 'all', + array( + 'conditions' => array( + 'Article.id !=' => array(1) + ) + ) + ); + $this->assertTrue(is_array($result) && !empty($result)); + } + /** * test custom find method *