Example #1
0
 public function testGetModulesByFrontName()
 {
     $frontName = 'route';
     $scope = null;
     $this->_object->expects($this->once())->method('getModulesByFrontName')->with($frontName, $scope);
     $this->_proxy->getModulesByFrontName($frontName, $scope);
 }
Example #2
0
 public function testMatchEmptyActionInstance()
 {
     // Test Data
     $nullActionInstance = null;
     $moduleFrontName = 'module front name';
     $actionPath = 'action path';
     $actionName = 'action name';
     $actionClassName = 'Magento\\Cms\\Controller\\Index\\Index';
     $moduleName = 'module name';
     $moduleList = [$moduleName];
     // Stubs
     $this->requestMock->expects($this->any())->method('getModuleName')->willReturn($moduleFrontName);
     $this->routeConfigMock->expects($this->any())->method('getModulesByFrontName')->willReturn($moduleList);
     $this->requestMock->expects($this->any())->method('getControllerName')->willReturn($actionPath);
     $this->requestMock->expects($this->any())->method('getActionName')->willReturn($actionName);
     $this->appStateMock->expects($this->any())->method('isInstalled')->willReturn(false);
     $this->actionListMock->expects($this->any())->method('get')->willReturn($actionClassName);
     $this->actionFactoryMock->expects($this->any())->method('create')->willReturn($nullActionInstance);
     // Expectations and Test
     $this->assertNull($this->model->match($this->requestMock));
 }