lithium\tests\cases\data\model\QueryTest::testModels PHP Метод

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

public testModels ( )
    public function testModels()
    {
        $model = 'lithium\\tests\\mocks\\data\\model\\MockQueryPost';
        $query = new Query(array('type' => 'read', 'model' => $model, 'with' => 'MockQueryComment'));
        $expected = array('MockQueryPost' => 'lithium\\tests\\mocks\\data\\model\\MockQueryPost', 'MockQueryComment' => 'lithium\\tests\\mocks\\data\\model\\MockQueryComment');
        $this->assertEqual($expected, $query->models($this->_db));
        $query = new Query(array('type' => 'read', 'model' => $model, 'alias' => 'Post', 'with' => array('MockQueryComment' => array('alias' => 'Comment'), 'MockQueryComment.MockQueryPost' => array('alias' => 'Post2'))));
        $expected = array('Post' => 'lithium\\tests\\mocks\\data\\model\\MockQueryPost', 'Comment' => 'lithium\\tests\\mocks\\data\\model\\MockQueryComment', 'Post2' => 'lithium\\tests\\mocks\\data\\model\\MockQueryPost');
        $this->assertEqual($expected, $query->models($this->_db));
    }