Browse Source

Added test case for fix in e1738c8c

Scott Harwell 14 years ago
parent
commit
dddcdd105e
1 changed files with 23 additions and 0 deletions
  1. 23 0
      lib/Cake/Test/Case/Model/ModelReadTest.php

+ 23 - 0
lib/Cake/Test/Case/Model/ModelReadTest.php

@@ -7784,4 +7784,27 @@ class ModelReadTest extends BaseModelTest {
 		$this->assertEquals($Post->getVirtualField('other_field'), $Post->virtualFields['other_field']);
 		$this->assertEquals($Post->getVirtualField('Post.other_field'), $Post->virtualFields['other_field']);
 	}
+	
+	
+/**
+ * test that checks for error when NOT condition passed in key and a 1 element array value
+ *
+ * @return void
+ */	
+	public function testNotInArrayWithOneValue() {
+		$this->loadFixtures('Article');
+		$Article = new Article();
+		$Article->recursive = -1;
+		
+		$result = $Article->find(
+			'all',
+			array(
+				'conditions' => array(
+					'Article.id NOT' => array(1)
+				)
+			)
+		);
+		
+		$this->assertTrue(is_array($result) && !empty($result));
+    }
 }