30 protected function setUp(): void
38 protected const BASE_PATH =
"plugins/";
44 protected function scanDir(
string $dir): array
46 $this->test->scanned[] = $dir;
47 return $this->test->dirs[$dir] ?? [];
49 public function _scanDir(
string $dir): array
51 return parent::scanDir($dir);
53 protected function isDir(
string $dir):
bool 57 public function _isDir(
string $dir):
bool 59 return parent::isDir($dir);
61 public function _isDotFile(
string $file):
bool 63 return parent::isDotFile($file);
65 protected function buildPluginPath(
string $component,
string $slot,
string $plugin):
string 67 return $this->test->files[parent::buildPluginPath($component, $slot, $plugin)];
70 public function _buildPluginPath(
string $component,
string $slot,
string $plugin):
string 72 return parent::buildPluginPath($component, $slot, $plugin);
74 protected function addPlugin(array &
$data,
string $component,
string $slot,
string $plugin):
void 76 $this->test->added[] =
"$component/$slot/$plugin";
78 public function _addPlugin(array &$data,
string $component,
string $slot,
string $plugin):
void 80 parent::addPlugin($data, $component, $slot, $plugin);
87 $this->builder->build();
89 $expected = [
"plugins/"];
92 $this->assertEquals($expected, $this->scanned);
98 "plugins/" => [
"Module1",
"Module2"],
99 "plugins/Module1" => [
"Slot1",
"Slot2"],
100 "plugins/Module2" => []
103 $this->builder->build();
105 $expected = [
"plugins/",
"plugins/Module1",
"plugins/Module2",
106 "plugins/Module1/Slot1",
"plugins/Module1/Slot2"];
108 sort($this->scanned);
109 $this->assertEquals($expected, $this->scanned);
115 "plugins/" => [
"Module1"],
116 "plugins/Module1" => [
"Slot1"],
117 "plugins/Module1/Slot1" => [
"Plugin1",
"Plugin2"]
120 $this->builder->build();
123 "Module1/Slot1/Plugin1",
124 "Module1/Slot1/Plugin2" 128 $this->assertEquals($expected, $this->added);
134 $expected = [
"Component.php",
"README.md",
"ROADMAP.md",
"classes",
"exceptions",
"maintenance.json",
"service.xml",
"src",
"tests"];
135 $actual = array_values(
137 $this->builder->_scanDir(__DIR__ .
"/../.."),
138 [
"artifacts",
".DS_Store"]
141 $this->assertEquals($expected, $actual);
148 $actual = $this->builder->_isDir(__DIR__ .
"/../..");
149 $this->assertEquals($expected, $actual);
155 $actual = $this->builder->_isDotFile(
".DS_Store");
156 $this->assertEquals($expected, $actual);
162 $this->files[
"plugins/Module1/Slot1/Plugin1/"] = __DIR__ .
"/";
163 $this->builder->_addPlugin(
$data,
"Module1",
"Slot1",
"Plugin1");
175 "richard.klees@concepts-and-training.de",
181 $this->assertEquals($expected,
$data);
186 $this->assertEquals(
"plugins/COMPONENT/SLOT/PLUGIN/", $this->builder->_buildPluginPath(
"COMPONENT",
"SLOT",
"PLUGIN"));
ilComponentBuildPluginInfoObjective $builder
sort()
description: > Example for rendering a Sort Glyph.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
__construct(Container $dic, ilPlugin $plugin)