示例#1
0
 public function testDirectoriesCustomization()
 {
     $config = [DirectoryList::APP => [DirectoryList::PATH => 'foo', DirectoryList::URL_PATH => 'bar']];
     $object = new DirectoryList('/root/dir', $config);
     $this->assertFileExists($object->getPath(DirectoryList::SYS_TMP));
     $this->assertEquals('/root/dir/foo', $object->getPath(DirectoryList::APP));
     $this->assertEquals('bar', $object->getUrlPath(DirectoryList::APP));
     $this->setExpectedException('\\Magento\\Framework\\Filesystem\\FilesystemException', "Unknown directory type: 'unknown'");
     $object->getPath('unknown');
 }
示例#2
0
 public function testPrependRoot()
 {
     $object = new DirectoryList('/root/dir', [DirectoryList::SYS_TMP => [DirectoryList::PATH => 'tmp']]);
     $this->assertEquals('/root/dir/tmp', $object->getPath(DirectoryList::SYS_TMP));
 }