Tests/Unit/Consume/ImportSyncConsumerTest.php
/**
     * Tests normal logic of ImportSyncConsumer.
     */
Tests normal logic of ImportSyncConsumer.
Tests normal logic of ImportSyncConsumer .
public function testImportSyncNormal()
    {
        $mockManager = $this->getMockBuilder('ONGR\ElasticsearchBundle\ORM\Manager')
            ->disableOriginalConstructor()
            ->getMock();
        $mockStorage = $this->getMockBuilder('ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorage')
            ->disableOriginalConstructor()
            ->getMock();
        $mockStorage->expects($this->once())->method('deleteItem')->with('-1');
        $mockDoc = $this->getMockForAbstractClass('ONGR\ElasticsearchBundle\Document\DocumentInterface');
        $import = new ImportSyncConsumer($mockManager, $mockStorage);
        $event = new ItemPipelineEvent(new ImportItem(['sync_id' => -1], $mockDoc));
        $import->onConsume($event);
    }
public function testImportSyncNormal ( ) { $ mockManager = $ this -> getMockBuilder ( 'ONGR\ElasticsearchBundle\ORM\Manager' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ mockStorage = $ this -> getMockBuilder ( 'ONGR\ConnectionsBundle\Sync\SyncStorage\SyncStorage' ) -> disableOriginalConstructor ( ) -> getMock ( ) ; $ mockStorage -> expects ( $ this -> once ( ) ) -> method ( 'deleteItem' ) -> with ( '-1' ) ; $ mockDoc = $ this -> getMockForAbstractClass ( 'ONGR\ElasticsearchBundle\Document\DocumentInterface' ) ; $ import = new ImportSyncConsumer ( $ mockManager , $ mockStorage ) ; $ event = new ItemPipelineEvent ( new ImportItem ( [ 'sync_id' => - 1 ] , $ mockDoc ) ) ; $ import -> onConsume ( $ event ) ; }
Tests normal logic of ImportSyncConsumer.
Tests normal logic of ImportSyncConsumer .