public function testAttachAndNotify() { $type = 'test_type'; $this->component->expects($this->any())->method('getComponentName')->willReturn($type); $this->observer->expects($this->any())->method('update')->with($this->component); /** @var UiComponentInterface $component2 */ $component2 = $this->getMockBuilder('Magento\\Framework\\View\\Element\\UiComponentInterface')->getMockForAbstractClass(); $component2->expects($this->any())->method('getComponentName')->willReturn('other_type'); $this->processor->register($this->component); $this->processor->register($component2); $this->processor->attach($type, $this->observer); $this->processor->notify($type); }