19 declare(strict_types=1);
35 '.phpunit.result.cache',
36 'captainhook.local.json',
38 'phpstan-baseline.neon',
40 '.php-cs-fixer.cache',
51 'unzip_test_file.zip',
78 protected function setUp(): void
81 self::ALLOWED_ROOT_FOLDER_DIRS,
82 explode(
",", (
string) getenv(
'ALLOWED_ROOT_FOLDER_DIRS'))
85 self::ALLOWED_ROOT_FOLDER_FILES,
86 explode(
",", (
string) getenv(
'ALLOWED_ROOT_FOLDER_FILES'))
92 $app_root_folder = __DIR__ .
"/../../../../";
94 if (!is_file($app_root_folder .
'/ilias_version.php')) {
95 $this->fail(
'Could not determine ILIAS root folder');
98 return $app_root_folder;
101 public function testAppRootFolderOnlyContainsDefinedFiles():
void 104 $iter = new \CallbackFilterIterator(
107 return $file->isFile();
110 foreach ($iter as $file) {
112 $found_files[] = $file->getBasename();
121 'The following files are not expected in the ILIAS root folder: %s',
122 implode(
', ', $unexpected_files)
127 public function testAppRootFolderOnlyContainsDefinedFolders():
void 129 $found_directories = [];
130 $iter = new \CallbackFilterIterator(
133 return $file->isDir() && !$file->isDot();
136 foreach ($iter as $file) {
138 $found_directories[] = $file->getBasename();
142 sort($unexpected_directories);
145 $unexpected_directories,
147 'The following directories are not expected in the ILIAS root folder: %s',
148 implode(
', ', $unexpected_directories)
const ALLOWED_ROOT_FOLDER_DIRS
sort()
description: > Example for rendering a Sort Glyph.
const ALLOWED_ROOT_FOLDER_FILES
array $ALLOWED_ROOT_FOLDER_DIRS
array $ALLOWED_ROOT_FOLDER_FILES