AssetManagerTest\ModuleTest::testOnDispatchDoesntResolveToAsset PHP Method

testOnDispatchDoesntResolveToAsset() public method

    public function testOnDispatchDoesntResolveToAsset()
    {
        $resolver = $this->getMock(ResolverInterface::class);
        $assetManager = $this->getMock(AssetManager::class, array('resolvesToAsset'), array($resolver));
        $assetManager->expects($this->once())->method('resolvesToAsset')->will($this->returnValue(false));
        $serviceManager = $this->getMock(ServiceLocatorInterface::class);
        $serviceManager->expects($this->any())->method('get')->will($this->returnValue($assetManager));
        $application = $this->getMock(ApplicationInterface::class);
        $application->expects($this->once())->method('getServiceManager')->will($this->returnValue($serviceManager));
        $event = new MvcEvent();
        $response = new Response();
        $request = new Request();
        $module = new Module();
        $event->setApplication($application);
        $response->setStatusCode(404);
        $event->setResponse($response);
        $event->setRequest($request);
        $return = $module->onDispatch($event);
        $this->assertNull($return);
    }