Tests/Unit/Modifier/ImportModifierTest.php
/**
     * Tests behaviour of modifier when an ImportItem is given.
     */
Tests behaviour of modifier when an ImportItem is given.
Tests behaviour of modifier when an ImportItem is given .
public function testImportModifierGoodImportItem()
    {
        $mod = new ImportModifier();
        $mockDocument = $this->getMockForAbstractClass('ONGR\ElasticsearchBundle\Document\DocumentInterface');
        $mockItem = $this
            ->getMockBuilder('ONGR\ConnectionsBundle\Pipeline\Item\ImportItem')
            ->setMethods(['getDocument', 'setDocument'])
            ->disableOriginalConstructor()
            ->getMockForAbstractClass();
        $mockItem->expects($this->once())->method('setDocument');
        $mockItem->expects($this->once())->method('getDocument')->willReturn($mockDocument);
        $mod->modify($mockItem, new ItemPipelineEvent(null));
    }
public function testImportModifierGoodImportItem ( ) { $ mod = new ImportModifier ( ) ; $ mockDocument = $ this -> getMockForAbstractClass ( 'ONGR\ElasticsearchBundle\Document\DocumentInterface' ) ; $ mockItem = $ this -> getMockBuilder ( 'ONGR\ConnectionsBundle\Pipeline\Item\ImportItem' ) -> setMethods ( [ 'getDocument' , 'setDocument' ] ) -> disableOriginalConstructor ( ) -> getMockForAbstractClass ( ) ; $ mockItem -> expects ( $ this -> once ( ) ) -> method ( 'setDocument' ) ; $ mockItem -> expects ( $ this -> once ( ) ) -> method ( 'getDocument' ) -> willReturn ( $ mockDocument ) ; $ mod -> modify ( $ mockItem , new ItemPipelineEvent ( null ) ) ; }
Tests behaviour of modifier when an ImportItem is given.
Tests behaviour of modifier when an ImportItem is given .