Example #1
0
 public function testMultiRecordDelete()
 {
     $result = MockPost::remove(array('published' => false));
     $query = $result['query'];
     $this->assertEqual('delete', $query->type());
     $this->assertEqual(array('published' => false), $query->conditions());
     $keys = array_keys(array_filter($query->export(MockPost::connection())));
     $this->assertEqual(array('conditions', 'model', 'type', 'source', 'alias'), $keys);
 }
Example #2
0
 public function testMultiRecordDelete()
 {
     $result = MockPost::remove(array('published' => false));
     $query = $result['query'];
     $this->assertEqual('delete', $query->type());
     $this->assertEqual(array('published' => false), $query->conditions());
     $keys = array_keys(array_filter($query->export(Connections::get('mock-source'))));
     $expected = array('name', 'conditions', 'model', 'source');
     $this->assertEqual($expected, $keys);
 }