Tests/Unit/Import/ImportSubQueryTest.php
/**
     * Tests behaviour of subQuery class with existent class subquery.
     */
Tests behaviour of subQuery class with existent class subquery.
Tests behaviour of subQuery class with existent class subquery .
public function testImportSubQueryMultiOk()
    {
        $mockConnection = $this->getMockConnection(1, [ 0 => [ 0 => 'the only result'] ]);
        $mockDocument = $this->getMockForAbstractClass('ONGR\ElasticsearchBundle\Document\DocumentInterface');
        $subQuery = new ImportSubQuery(
            $mockConnection,
            'parentId',
            'keyFrom',
            'keyTo',
            get_class($mockDocument),
            'anyquery',
            [ 'self' => ImportSubQuery::SELF_ID ],
            '~~~'
        );
        $this->assertEquals(1, count($subQuery->execute('1', 0)));
    }
public function testImportSubQueryMultiOk ( ) { $ mockConnection = $ this -> getMockConnection ( 1 , [ 0 => [ 0 => 'the only result' ] ] ) ; $ mockDocument = $ this -> getMockForAbstractClass ( 'ONGR\ElasticsearchBundle\Document\DocumentInterface' ) ; $ subQuery = new ImportSubQuery ( $ mockConnection , 'parentId' , 'keyFrom' , 'keyTo' , get_class ( $ mockDocument ) , 'anyquery' , [ 'self' => ImportSubQuery :: SELF_ID ] , '~~~' ) ; $ this -> assertEquals ( 1 , count ( $ subQuery -> execute ( '1' , 0 ) ) ) ; }
Tests behaviour of subQuery class with existent class subquery.
Tests behaviour of subQuery class with existent class subquery .