Exemplo n.º 1
0
 /**
  * @return void
  */
 public function testExecute()
 {
     $titleMock = $this->getMockBuilder('Magento\\Framework\\View\\Page\\Title')->disableOriginalConstructor()->getMock();
     $titleMock->expects($this->once())->method('prepend')->with(new Phrase('Order Count Report'));
     $this->viewMock->expects($this->any())->method('getPage')->willReturn(new DataObject(['config' => new DataObject(['title' => $titleMock])]));
     $this->menuBlockMock->expects($this->once())->method('setActive')->with('Magento_Reports::report_customers_orders');
     $this->breadcrumbsBlockMock->expects($this->at(0))->method('addLink')->with(new Phrase('Reports'), new Phrase('Reports'));
     $this->breadcrumbsBlockMock->expects($this->at(1))->method('addLink')->with(new Phrase('Customers'), new Phrase('Customers'));
     $this->breadcrumbsBlockMock->expects($this->at(2))->method('addLink')->with(new Phrase('Customers by Number of Orders'), new Phrase('Customers by Number of Orders'));
     $this->orders->execute();
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'dispatch');
     if (!$pluginInfo) {
         return parent::dispatch($request);
     } else {
         return $this->___callPlugins('dispatch', func_get_args(), $pluginInfo);
     }
 }