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

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

Tests that complex model constraints with custom operators render correct constraint strings.
    public function testRenderArrayJoinConstraintComplex()
    {
        $model = 'lithium\\tests\\mocks\\data\\model\\MockQueryComment';
        $query = new Query(compact('model') + array('type' => 'read', 'source' => 'comments', 'alias' => 'Comments', 'conditions' => array('Comment.id' => 1), 'joins' => array(array('mode' => 'INNER', 'source' => 'posts', 'alias' => 'Post', 'constraints' => array('Comment.post_id' => array('<=' => 'Post.id'))))));
        $expected = "SELECT * FROM {comments} AS {Comments} INNER JOIN {posts} AS {Post} ON ";
        $expected .= "({Comment}.{post_id} <= {Post}.{id}) WHERE {Comment}.{id} = 1;";
        $result = $this->_db->renderCommand($query);
        $this->assertEqual($expected, $result);
    }
DatabaseTest