public function testConstructor() { $pathPattern = self::
$fixturesPath.'/templates/%name%.%engine%';
$loader =
new ProjectTemplateFilesystemLoader($pathPattern);
$this->
assertEquals([$pathPattern],
$loader->
getTemplatePathPatterns(), '__construct() takes a path as its second argument'
);
$loader =
new ProjectTemplateFilesystemLoader([$pathPattern]);
$this->
assertEquals([$pathPattern],
$loader->
getTemplatePathPatterns(), '__construct() takes an array of paths as its second argument'
);
} public function testIsAbsolutePath() { $this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('/foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
$this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('c:\\\\foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
$this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('c:/foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
$this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('\\server\\foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
$this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('https://server/foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
$this->
assertTrue(ProjectTemplateFilesystemLoader::
isAbsolutePath('phar://server/foo.xml'
), '->isAbsolutePath() returns true if the path is an absolute path'
);
} public function testLoad() { $pathPattern = self::
$fixturesPath.'/templates/%name%';
$path = self::
$fixturesPath.'/templates';