ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ComponentResourceTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use PHPUnit\Framework\TestCase;
26
27class ComponentResourceTest extends TestCase
28{
29 public function testTarget1()
30 {
31 $public_asset = new R\OfComponent(
32 new \ILIAS\Component(),
33 "asset.png",
34 "some/target"
35 );
36
37 $this->assertEquals("some/target/asset.png", $public_asset->getTarget());
38 }
39
40 public function testTarget2()
41 {
42 $public_asset = new R\OfComponent(
43 new \ILIAS\Component(),
44 "directory/asset.png",
45 "some/target"
46 );
47
48 $this->assertEquals("some/target/asset.png", $public_asset->getTarget());
49 }
50
51 public function testTarget3()
52 {
53 $public_asset = new R\OfComponent(
54 new \ILIAS\Component(),
55 "directory/asset.png",
56 "some/target"
57 );
58
59 $this->assertEquals("some/target/asset.png", $public_asset->getTarget());
60 }
61
63 {
64 $public_asset = new R\OfComponent(
65 new \ILIAS\Component(),
66 ".htaccess",
67 "target"
68 );
69
70 $this->assertTrue(true);
71 }
72
73 public function testDotIsAllowedAsTarget()
74 {
75 $public_asset = new R\OfComponent(
76 new \ILIAS\Component(),
77 "foo.php",
78 "."
79 );
80
81 $this->assertTrue(true);
82 }
83
84 public function testSource()
85 {
86 $public_asset = new R\OfComponent(
87 new \ILIAS\Component(),
88 "directory/asset.png",
89 "some/target"
90 );
91
92 $this->assertEquals("components/ILIAS/Component/resources/directory/asset.png", $public_asset->getSource());
93 }
94}
An public asset that is a resource of some component.
Definition: OfComponent.php:27
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.