lithium\tests\integration\data\DatabaseTest::testOneToMany PHP Метод

testOneToMany() публичный Метод

public testOneToMany ( )
    public function testOneToMany()
    {
        $opts = array('conditions' => array('Galleries.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)->data();
        $expected = (include $this->_export . '/testOneToMany.php');
        $gallery = Galleries::find('first', $opts + array('with' => 'Images'))->data();
        $this->assertEqual(3, count($gallery['images']));
        $this->assertEqual(reset($expected), $gallery);
    }