TestCase for the ilWACCheckingInstanceTest.
More...
TestCase for the ilWACCheckingInstanceTest.
- Author
- Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
- Version
- 1.0.0
needsInstalledILIAS
disabled disabled disabled
Definition at line 27 of file ilWACCheckingInstanceTest.php.
◆ setUp()
ilWACCheckingInstanceTest::setUp |
( |
| ) |
|
|
protected |
Setup.
Definition at line 47 of file ilWACCheckingInstanceTest.php.
References $container, $GLOBALS, $http, $ilUser, ILIAS\FileDelivery\http(), ilWebAccessCheckerDelivery\run(), and ilWACToken\setSALT().
51 require_once(
'./Services/WebAccessChecker/classes/class.ilWebAccessChecker.php');
52 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
53 require_once(
'./Services/WebAccessChecker/classes/class.ilWACToken.php');
54 require_once(
'./Services/WebAccessChecker/classes/class.ilWebAccessCheckerDelivery.php');
55 $this->root = vfs\vfsStream::setup(
'ilias.de');
56 $this->file_one = vfs\vfsStream::newFile(
'data/trunk/mobs/mm_123/dummy.jpg')
57 ->at($this->root)->setContent(
'dummy');
62 return Mockery::mock(GlobalHttpState::class);
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static http()
Fetches the global http state from ILIAS.
◆ testBasic()
ilWACCheckingInstanceTest::testBasic |
( |
| ) |
|
Definition at line 146 of file ilWACCheckingInstanceTest.php.
References ilWACException\ACCESS_DENIED_NO_PUB, array, and ilWebAccessChecker\check().
148 self::markTestSkipped(
"Can't run test without db.");
152 require_once(
'./Services/User/classes/class.ilObjUser.php');
156 $check = $ilWebAccessChecker->
check();
160 $this->assertFalse($check);
161 $this->assertEquals(
array(
162 $ilWebAccessChecker::CM_CHECKINGINSTANCE,
163 ), $ilWebAccessChecker->getAppliedCheckingMethods());
Class ilWebAccessChecker.
Create styles array
The data for the language used.
const ACCESS_DENIED_NO_PUB
◆ testBasicWithFileSigning()
ilWACCheckingInstanceTest::testBasicWithFileSigning |
( |
| ) |
|
Definition at line 167 of file ilWACCheckingInstanceTest.php.
References $response, ilWACException\ACCESS_DENIED_NO_PUB, array, ILIAS\FileDelivery\http(), and ilWACSignedPath\signFile().
169 self::markTestSkipped(
"WIP");
176 $check = $ilWebAccessChecker->check();
180 $this->assertTrue($check);
181 $this->assertEquals(
array(
182 $ilWebAccessChecker::CM_FILE_TOKEN,
183 ), $ilWebAccessChecker->getAppliedCheckingMethods());
185 $headerName =
'X-ILIAS-WebAccessChecker';
187 $this->assertTrue(
$response->hasHeader($headerName));
188 $this->assertEquals([
'checked using token' ],
$response->getHeader($headerName));
static http()
Fetches the global http state from ILIAS.
Class ilWebAccessChecker.
static signFile($path_to_file)
Create styles array
The data for the language used.
const ACCESS_DENIED_NO_PUB
◆ testBasicWithFolderSigning()
ilWACCheckingInstanceTest::testBasicWithFolderSigning |
( |
| ) |
|
Definition at line 192 of file ilWACCheckingInstanceTest.php.
References $response, ilWACException\ACCESS_DENIED_NO_PUB, array, ILIAS\FileDelivery\http(), and ilWACSignedPath\signFolderOfStartFile().
194 self::markTestSkipped(
"WIP");
200 $check = $ilWebAccessChecker->check();
204 $this->assertTrue($check);
205 $this->assertEquals(
array(
206 $ilWebAccessChecker::CM_FOLDER_TOKEN,
207 ), $ilWebAccessChecker->getAppliedCheckingMethods());
209 $headerName =
'X-ILIAS-WebAccessChecker';
211 $this->assertTrue(
$response->hasHeader($headerName));
212 $this->assertEquals([
'checked using secure folder' ],
$response->getHeader($headerName));
static signFolderOfStartFile($start_file_path)
static http()
Fetches the global http state from ILIAS.
Class ilWebAccessChecker.
Create styles array
The data for the language used.
const ACCESS_DENIED_NO_PUB
◆ testNonCheckingInstanceNoSec()
ilWACCheckingInstanceTest::testNonCheckingInstanceNoSec |
( |
| ) |
|
Definition at line 219 of file ilWACCheckingInstanceTest.php.
References $_SESSION, $file, ilWACException\ACCESS_DENIED_NO_PUB, array, ilWebAccessChecker\check(), and defined.
221 self::markTestSkipped(
"Can't run test without db.");
225 $file = vfs\vfsStream::newFile(
'data/trunk/dummy/mm_123/dummy.jpg')->at($this->root)
226 ->setContent(
'dummy');
230 if (!
defined(
'IL_PHPUNIT_TEST')) {
231 define(
'IL_PHPUNIT_TEST',
true);
233 session_id(
'phpunittest');
235 include
'Services/PHPUnit/config/cfg.phpunit.php';
237 $check = $ilWebAccessChecker->
check();
Class ilWebAccessChecker.
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
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ $file_one
ilWACCheckingInstanceTest::$file_one |
|
protected |
◆ $http
ilWACCheckingInstanceTest::$http |
|
private |
◆ $root
ilWACCheckingInstanceTest::$root |
|
protected |
The documentation for this class was generated from the following file: