Tests/Unit/Import/ImportIteratorTest.php
/**
     * Tests behaviour of ImportIterator with subqueries present, but no source id data.
     */
Tests behaviour of ImportIterator with subqueries present, but no source id data.
Tests behaviour of ImportIterator with subqueries present but no source id data .
public function testImportIteratorCount()
    {
        $mockRepository = $this->getMockBuilder('ONGR\ElasticsearchBundle\ORM\Repository')
            ->disableOriginalConstructor()->getMock();
        $mockStatement = $this->getMockBuilder('Doctrine\DBAL\Statement')->disableOriginalConstructor()->getMock();
        $mockStatement->expects($this->any())->method('getIterator')->willReturn(new \ArrayIterator());
        $iterator = new ImportIterator($mockStatement, [], $mockRepository);
        $this->assertEquals(0, count($iterator));
    }
public function testImportIteratorCount ( ) { $ mockRepository = $ this -> getMockBuilder ( 'ONGR\ElasticsearchBundle\ORM\Repository' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ mockStatement = $ this -> getMockBuilder ( 'Doctrine\DBAL\Statement' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ mockStatement -> expects ( $ this -> any ( ) ) -> method ( 'getIterator' ) -> willReturn ( new \ ArrayIterator ( ) ) ; $ iterator = new ImportIterator ( $ mockStatement , [ ] , $ mockRepository ) ; $ this -> assertEquals ( 0 , count ( $ iterator ) ) ; }
Tests behaviour of ImportIterator with subqueries present, but no source id data.
Tests behaviour of ImportIterator with subqueries present but no source id data .