Exemple #1
0
 protected function setUp()
 {
     $this->objectManager = new ObjectManager($this);
     $this->factoryMock = $this->getMockBuilder(ModifierFactory::class)->disableOriginalConstructor()->getMock();
     $this->dataProviderMockOne = $this->getMockBuilder(ModifierInterface::class)->setMethods(['getData', 'getMeta', 'setData', 'setMeta'])->getMockForAbstractClass();
     $this->dataProviderMockTwo = clone $this->dataProviderMockOne;
     $this->factoryMock->expects($this->any())->method('create')->willReturnMap([['DataProviderMockOne', [], $this->dataProviderMockOne], ['DataProviderMockTwo', [], $this->dataProviderMockTwo]]);
 }
 /**
  * @return void
  */
 protected function initModifiers()
 {
     $this->modifierMock = $this->getMockBuilder('StdClass')->setMethods(['modifyData', 'modifyMeta'])->getMock();
     $this->modifierFactoryMock->expects($this->once())->method('create')->with('namespase\\SomeClass')->willReturn($this->modifierMock);
 }