public function tearDown()
 {
     MockPost::$connection = null;
     MockTag::$connection = null;
     MockComment::$connection = null;
     MockCreator::$connection = null;
     MockPost::reset();
     MockTag::reset();
     MockComment::reset();
     MockPostForValidates::reset();
     MockCreator::reset();
 }
Beispiel #2
0
 public function testFindFirst()
 {
     MockTag::config(array('meta' => array('key' => 'id')));
     $tag = MockTag::find('first', array('conditions' => array('id' => 2)));
     $tag2 = MockTag::find(2);
     $tag3 = MockTag::first(2);
     $expected = $tag['query']->export(MockTag::connection());
     $this->assertEqual($expected, $tag2['query']->export(MockTag::connection()));
     $this->assertEqual($expected, $tag3['query']->export(MockTag::connection()));
     $tag = MockTag::find('first', array('conditions' => array('id' => 2), 'return' => 'array'));
     $expected['return'] = 'array';
     $this->assertTrue($tag instanceof Query);
     $this->assertEqual($expected, $tag->export(MockTag::connection()));
 }