本文整理汇总了PHP中tao_helpers_File::containsFileType方法的典型用法代码示例。如果您正苦于以下问题:PHP tao_helpers_File::containsFileType方法的具体用法?PHP tao_helpers_File::containsFileType怎么用?PHP tao_helpers_File::containsFileType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tao_helpers_File
的用法示例。
在下文中一共展示了tao_helpers_File::containsFileType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDeleteDirectoryById
/**
* Test if delete directory works
*/
public function testDeleteDirectoryById()
{
$id = 'polop-';
$file = 'test.txt';
$this->assertFalse(\tao_helpers_File::containsFileType($this->privateDir, 'txt', true));
$fileStorage = $this->getFileStorage();
$directoryStorage = $fileStorage->getDirectoryById($id);
$stream = fopen('data://text/plain;base64,' . base64_encode('testContent'), 'r');
$directoryStorage->writeStream($file, $stream);
$this->assertTrue($directoryStorage->has($file));
$this->assertTrue(\tao_helpers_File::containsFileType($this->privateDir, 'txt', true));
$this->assertTrue($fileStorage->deleteDirectoryById($id));
$this->assertFalse($directoryStorage->has($file));
$this->assertFalse(\tao_helpers_File::containsFileType($this->privateDir, 'txt', true));
$reflectionClass = new \ReflectionClass('\\tao_models_classes_service_FileStorage');
$reflectionMethod = $reflectionClass->getMethod('id2path');
$reflectionMethod->setAccessible(true);
$path = $reflectionMethod->invokeArgs($fileStorage, [$id]);
// check for the directory itself
$this->assertFalse(file_exists($path));
}