/** * {@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); } }
/** * @covers \Magento\Backup\Controller\Adminhtml\Index\Download::execute * @param int $time * @param bool $exists * @param int $existsCount * @dataProvider executeBackupNotFoundDataProvider */ public function testExecuteBackupNotFound($time, $exists, $existsCount) { $type = 'db'; $this->backupModelMock->expects($this->atLeastOnce())->method('getTime')->willReturn($time); $this->backupModelMock->expects($this->exactly($existsCount))->method('exists')->willReturn($exists); $this->requestMock->expects($this->any())->method('getParam')->willReturnMap([['time', null, $time], ['type', null, $type]]); $this->backupModelFactoryMock->expects($this->once())->method('create')->with($time, $type)->willReturn($this->backupModelMock); $this->resultRedirectMock->expects($this->once())->method('setPath')->with('backup/*'); $this->resultRedirectFactoryMock->expects($this->once())->method('create')->willReturn($this->resultRedirectMock); $this->assertSame($this->resultRedirectMock, $this->downloadController->execute()); }