public function testGetUri() { $serviceManager = Bootstrap::getServiceManager(); $apiService = $serviceManager->get('Columnis\\Service\\ApiService'); /* @var $apiService ApiService */ $endpoint = "/" . Bootstrap::getRandString(); $clientNumber = $apiService->getClientNumber(); $this->assertEquals($clientNumber . '/columnis' . $endpoint, $apiService->getUri($endpoint)); }
public function testIsSubpath() { $folder = Bootstrap::getRandString(); $subfolder = Bootstrap::getRandString(); $path = __DIR__ . DIRECTORY_SEPARATOR . $folder; $subpath = $path . DIRECTORY_SEPARATOR . $subfolder; $create = mkdir($path); $this->assertTrue($create); $create2 = mkdir($subpath); $this->assertTrue($create2); $res = DirectoryUtils::isSubpath($path, $subpath); $this->assertTrue($res); $deleted = rmdir($subpath); $this->assertTrue($deleted); $deleted2 = rmdir($path); $this->assertTrue($deleted2); }
public function testIsValidWithNonExistantMainFile() { $template = new Template(); $path = $this->getExampleTemplatePath(); $template->setPath($path); $name = 'example-template'; $template->setName($name); $newName = $path . DIRECTORY_SEPARATOR . \ColumnisTest\Bootstrap::getRandString(); rename($template->getMainFile(), $newName); $this->assertFalse($template->isValid()); rename($newName, $template->getMainFile()); }