ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilWACPathTest.php
Go to the documentation of this file.
1 <?php
2 
12 
16  protected function setUp() {
17  require_once('./Services/WebAccessChecker/classes/class.ilWACPath.php');
18  require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
19  parent::setUp();
20  }
21 
22 
23  public function testMobs() {
24  $ilWacPath = new ilWACPath('http://trunk.local/data/trunk/mobs/mm_270/Koeniz_Komturei1.jpg');
25  $this->assertEquals('mobs', $ilWacPath->getModuleType());
26  $this->assertEquals('mm_270', $ilWacPath->getModuleIdentifier());
27  $this->assertEquals('Koeniz_Komturei1.jpg', $ilWacPath->getAppendix());
28  $this->assertEquals('trunk', $ilWacPath->getClient());
29  $this->assertFalse($ilWacPath->isInSecFolder());
30  $this->assertFalse($ilWacPath->isStreamable());
31  $this->assertFalse($ilWacPath->isVideo());
32  $this->assertFalse($ilWacPath->isAudio());
33  }
34 
35 
36  public function testUserImage() {
37  $ilWacPath = new ilWACPath('http://trunk.local/data/trunk/usr_images/usr_6_small.jpg?t=63944');
38  $this->assertEquals('usr_images', $ilWacPath->getModuleType());
39  $this->assertEquals('./data/trunk/usr_images/', $ilWacPath->getModulePath());
40  $this->assertEquals(null, $ilWacPath->getModuleIdentifier());
41  $this->assertEquals('usr_6_small.jpg', $ilWacPath->getAppendix());
42  $this->assertEquals('trunk', $ilWacPath->getClient());
43  $this->assertFalse($ilWacPath->isInSecFolder());
44  $this->assertFalse($ilWacPath->isStreamable());
45  $this->assertFalse($ilWacPath->isVideo());
46  $this->assertFalse($ilWacPath->isAudio());
47  }
48 
49 
50  public function testBlogInSec() {
51  $ilWacPath = new ilWACPath('http://trunk.local/data/trunk/sec/ilBlog/blog_123/Header.mp4');
52  $this->assertEquals('ilBlog', $ilWacPath->getModuleType());
53  $this->assertEquals('./data/trunk/sec/ilBlog/', $ilWacPath->getModulePath());
54  $this->assertEquals('blog_123', $ilWacPath->getModuleIdentifier());
55  $this->assertEquals('Header.mp4', $ilWacPath->getAppendix());
56  $this->assertEquals('trunk', $ilWacPath->getClient());
57  $this->assertTrue($ilWacPath->isInSecFolder());
58  $this->assertTrue($ilWacPath->isStreamable());
59  $this->assertTrue($ilWacPath->isVideo());
60  $this->assertFalse($ilWacPath->isAudio());
61  }
62 
63 
64  public function testSubfolders() {
65  $ilWacPathBase = new ilWACPath('http://trunk.local/data/trunk/lm_data/lm_123456/start.html');
66  $ilWacPathSub = new ilWACPath('http://trunk.local/data/trunk/lm_data/lm_123456/subfolder/image.png');
67  $this->assertEquals($ilWacPathBase->getModulePath(), $ilWacPathSub->getModulePath());
68  }
69 }
setUp()
Setup.
TestCase for the ilWACCheckingInstanceTest.
Class ilWACPath.