lithium\tests\cases\data\source\DatabaseTest::testReadWithRelationship PHP Метод

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

    public function testReadWithRelationship()
    {
        $options = array('type' => 'read', 'model' => $this->_model, 'with' => array('MockDatabaseComment'));
        $result = $this->_db->read(new Query($options), $options);
        $expected = 'SELECT * FROM {mock_database_posts} AS {MockDatabasePost} LEFT JOIN ';
        $expected .= '{mock_database_comments} AS {MockDatabaseComment} ON ';
        $expected .= '{MockDatabasePost}.{id} = {MockDatabaseComment}.{mock_database_post_id};';
        $this->assertEqual($expected, $this->_db->sql);
    }
DatabaseTest