Пример #1
0
 public function tearDown()
 {
     Galleries::remove();
     Galleries::reset();
 }
Пример #2
0
 public function tearDown()
 {
     $this->_db->dropSchema('galleries');
     Galleries::reset();
 }
Пример #3
0
 public function testOneToManyUsingSameKeyName()
 {
     Fixtures::drop('db', array('galleries'));
     $fixture = Fixtures::get('db', 'galleries');
     $fixture->alter('change', 'id', array('to' => 'gallery_id'));
     Fixtures::save('db', array('galleries'));
     Galleries::reset();
     Galleries::config(array('meta' => array('connection' => $this->_connection, 'key' => 'gallery_id')));
     $opts = array('conditions' => array('Galleries.gallery_id' => 1));
     $query = new Query($opts + array('type' => 'read', 'model' => 'lithium\\tests\\fixture\\model\\gallery\\Galleries', 'source' => 'galleries', 'alias' => 'Galleries', 'with' => array('Images')));
     $galleries = $this->_db->read($query);
     $this->assertCount(3, $galleries->first()->images);
 }
Пример #4
0
 /**
  * Dropping the test database
  */
 public function tearDown()
 {
     Fixtures::clear('db');
     Galleries::reset();
 }