Returns the servers deploy directory.
public getDeployDir ( AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface $containerNode, string $relativePathToAppend = '' ) : string | ||
$containerNode | AppserverIo\Appserver\Core\Api\Node\ContainerNodeInterface | The container to return the deployment directory for |
$relativePathToAppend | string | A relative path to append |
return | string |
/** * Tests if getting just the tmp directory works * * @return null */ public function testGetDeployDirNothingToAppend() { $mockHost = $this->getMockBuilder('\\AppserverIo\\Appserver\\Core\\Api\\Node\\HostNodeInterface')->setMethods(get_class_methods('\\AppserverIo\\Appserver\\Core\\Api\\Node\\HostNodeInterface'))->getMock(); $mockHost->expects($this->once())->method('getDeployBase')->willReturn('deploy'); $mockContainer = $this->getMockBuilder('\\AppserverIo\\Appserver\\Core\\Api\\Node\\ContainerNodeInterface')->setMethods(get_class_methods('\\AppserverIo\\Appserver\\Core\\Api\\Node\\ContainerNodeInterface'))->getMock(); $mockContainer->expects($this->once())->method('getHost')->willReturn($mockHost); $deployDir = $this->service->getDeployDir($mockContainer); $this->assertEquals('/opt/appserver/deploy', $deployDir); $this->assertNotEquals('/opt/appserver/deploy/test/directory', $deployDir); }
/** * Tests if getting just the tmp directory works * * @return null */ public function testGetDeployDirNothingToAppend() { $deployDir = $this->service->getDeployDir(); $this->assertEquals('/opt/appserver/deploy', $deployDir); $this->assertNotEquals('/opt/appserver/deploy/test/directory', $deployDir); }