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 testImportIteratorSubqueriesNoSrc()
    {
        $mockSubQuery = $this->getMockSubQuery();
        $mockSubQuery->expects($this->exactly(2))->method('getKeyFrom')->willReturn('no_key');
        $iterator = $this->getMockedImportIterator([$mockSubQuery]);
        foreach ($iterator as $key => $value) {
            $this->assertInstanceOf('ONGR\ConnectionsBundle\Pipeline\Item\ImportItem', $value);
            $this->assertEquals('test_return', $value->getEntity()['test_key_to']);
        }
    }
public function testImportIteratorSubqueriesNoSrc ( ) { $ mockSubQuery = $ this -> getMockSubQuery ( ) ; $ mockSubQuery -> expects ( $ this -> exactly ( 2 ) ) -> method ( 'getKeyFrom' ) -> willReturn ( 'no_key' ) ; $ iterator = $ this -> getMockedImportIterator ( [ $ mockSubQuery ] ) ; foreach ( $ iterator as $ key => $ value ) { $ this -> assertInstanceOf ( 'ONGR\ConnectionsBundle\Pipeline\Item\ImportItem' , $ value ) ; $ this -> assertEquals ( 'test_return' , $ value -> getEntity ( ) [ 'test_key_to' ] ) ; } }
Tests behaviour of ImportIterator with subqueries present, but no source id data.
Tests behaviour of ImportIterator with subqueries present but no source id data .