2 require_once(
'./libs/composer/vendor/autoload.php');
30 error_reporting(E_ALL);
31 require_once(
'./Services/WebAccessChecker/classes/class.ilWebAccessChecker.php');
32 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
33 require_once(
'./Services/WebAccessChecker/classes/class.ilWACToken.php');
34 require_once(
'./Services/WebAccessChecker/test/Token/mock/class.ilWACDummyCookie.php');
35 require_once(
'./Services/WebAccessChecker/test/Token/mock/class.ilWACDummyHeader.php');
36 require_once(
'./Services/WebAccessChecker/classes/class.ilWebAccessCheckerDelivery.php');
37 require_once(
'./libs/composer/vendor/autoload.php');
38 $this->root = vfs\vfsStream::setup(
'ilias.de');
39 $this->file_one = vfs\vfsStream::newFile(
'data/trunk/mobs/mm_123/dummy.jpg')->at($this->root)->setContent(
'dummy');
52 $base64 =
"iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5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5/1LqNlAK4e+fG1AQ/8YJmjezWzEHK9KrhDhdnxctm3M4QN7FwAl+JzetItY9sDbDdfXQoDvo9eAHK76q2NHV+0s25Z74uihLYooKeVyw0dviBce02Pf+kfa3jePM2+MQUxya/uKRtYzP+AUv/7y6D9OVVe9DAlpMYw7A4NCxjEsp6LETpa9+w4QCggdVDMxwVRbmi/V1ZaDH3zl7MlvttptrVe8FS11nl2XTvTjM4lhigP5Zi1H+xIt0woU81oZVo2DzWbXd3cUFhaiPXv2eHVSTqVODTdbpoWGR07VG005PK+K7KAHrgT1qoC1AULpR3tya7PbbNVNDZf2f1d3YXvd+XM7ZdF5qsvaD0KWlSj2VTiNUUG++XYW12I7JKjkwvwnHti9tdSlQUVFRUin03nFUSAhPS4r8nFw4k9rVSRAb9Qk6QzGNL3BlKjWaKKBpQfBjjrXdV21K2yVJLEBtOKcraXlZGuLtRp829ctsv20xqSTQo1xaGhyosv34C7MF8je6TKEiwjyfbt+blYKTx8zHvyKLi9r0oMyCNAgQIMA9YL8X4ABAIDrBNX7nKxZAAAAAElFTkSuQmCC";
53 $image = vfs\vfsStream::newFile(
'data/trunk/mobs/mm_123/dummy.png')->at($this->root)->setContent($base64);
54 $this->assertEquals($base64, $image->getContent());
56 require_once(
'./Services/PHPUnit/classes/class.ilUnitUtil.php');
58 $_POST[
"username"] =
'anonymous';
59 $_POST[
"password"] =
'anonymous';
60 ilUnitUtil::performInitialisation();
61 }
catch (ErrorException $e) {
65 $this->assertTrue($ilUser instanceof
ilObjUser);
66 $this->assertEquals(0, $ilUser->getId());
68 ob_start(
function ($buffer) {
76 $this->assertEquals(404, http_response_code());
81 require_once(
'./Services/User/classes/class.ilObjUser.php');
85 $check = $ilWebAccessChecker->
check();
89 $this->assertFalse($check);
90 $this->assertEquals(
array(
91 $ilWebAccessChecker::CM_CHECKINGINSTANCE,
92 ), $ilWebAccessChecker->getAppliedCheckingMethods());
103 $check = $ilWebAccessChecker->check();
107 $this->assertTrue($check);
108 $this->assertEquals(
array(
109 $ilWebAccessChecker::CM_FILE_TOKEN,
110 ), $ilWebAccessChecker->getAppliedCheckingMethods());
111 $this->assertEquals(
array(
112 'X-ILIAS-WebAccessChecker: checked using token',
113 ), $ilWACHeaderInterface->getSentHeaders());
124 $check = $ilWebAccessChecker->
check();
128 $this->assertTrue($check);
129 $this->assertEquals(
array(
130 $ilWebAccessChecker::CM_FOLDER_TOKEN,
131 ), $ilWebAccessChecker->getAppliedCheckingMethods());
132 $this->assertEquals(
array(
133 'X-ILIAS-WebAccessChecker: checked using secure folder',
134 ), $ilWACHeaderInterface->getSentHeaders());
140 $file = vfs\vfsStream::newFile(
'data/trunk/dummy/mm_123/dummy.jpg')->at($this->root)->setContent(
'dummy');
144 if (!
defined(
'IL_PHPUNIT_TEST')) {
145 define(
'IL_PHPUNIT_TEST',
true);
147 session_id(
'phpunittest');
149 include
'Services/PHPUnit/config/cfg.phpunit.php';
151 $check = $ilWebAccessChecker->
check();
TestCase for the ilWACCheckingInstanceTest.
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)
testBasicWithFileSigning()
testBasicWithFolderSigning()
Class ilWebAccessChecker.
testNonCheckingInstanceNoSec()
static signFile($path_to_file)
Create styles array
The data for the language used.
const ACCESS_DENIED_NO_PUB
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
tetDeliver()
disabled disabled disabled
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'