public function testFilePermissionsInstaller() { $request = $this->getMock('\\Zend\\Http\\PhpEnvironment\\Request', [], [], '', false); $response = $this->getMock('\\Zend\\Http\\PhpEnvironment\\Response', [], [], '', false); $routeMatch = $this->getMock('\\Zend\\Mvc\\Router\\RouteMatch', [], [], '', false); $mvcEvent = $this->getMock('\\Zend\\Mvc\\MvcEvent', [], [], '', false); $mvcEvent->expects($this->once())->method('setRequest')->with($request)->willReturn($mvcEvent); $mvcEvent->expects($this->once())->method('setResponse')->with($response)->willReturn($mvcEvent); $mvcEvent->expects($this->once())->method('setTarget')->with($this->environment)->willReturn($mvcEvent); $mvcEvent->expects($this->any())->method('getRouteMatch')->willReturn($routeMatch); $this->permissions->expects($this->once())->method('getMissingWritablePathsForInstallation'); $this->environment->setEvent($mvcEvent); $this->environment->dispatch($request, $response); $this->environment->filePermissionsAction(); }
public function testCheckApplicationFilePermissions() { $this->filePermissions->expects($this->once())->method('getUnnecessaryWritableDirectoriesForApplication')->willReturn(['foo', 'bar']); $expectedMessage = "For security, remove write permissions from these directories: 'foo' 'bar'"; $this->logger->expects($this->once())->method('log')->with($expectedMessage); $this->object->checkApplicationFilePermissions(); $this->assertSame(['message' => [$expectedMessage]], $this->object->getInstallInfo()); }
/** * @expectedException \Exception * @expectedExceptionMessage Missing write permissions to the following paths: */ public function testWritePermissionErrors() { $this->filePermissions->expects($this->once())->method('getMissingWritablePathsForInstallation')->willReturn(['/a/ro/dir', '/media']); $this->configModel->process([]); }