ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContextTest.php
Go to the documentation of this file.
1 <?php
3 
10 class ilContextTest extends TestCase
11 {
12  protected $backupGlobals = false;
13 
14  protected function setUp() : void
15  {
16  require_once("Services/Context/test/class.ilContextExtended.php");
17  }
18 
24  public function testInit($context, $className)
25  {
26  $context_obj = ilContextExtended::init($context);
27  $this->assertTrue($context_obj);
28  $this->assertEquals(ilContextExtended::getType(), $context);
29  $this->assertEquals(ilContextExtended::getClassName(), $className);
30  }
31 
32  public function contextProvider()
33  {
34  require_once("Services/Context/test/class.ilContextExtended.php");
35 
36  return array(array(ilContextExtended::CONTEXT_WEB,"ilContextWeb"),
37  array(ilContextExtended::CONTEXT_CRON,"ilContextCron"),
38  array(ilContextExtended::CONTEXT_RSS,"ilContextRss"),
39  array(ilContextExtended::CONTEXT_ICAL,"ilContextIcal"),
40  array(ilContextExtended::CONTEXT_SOAP,"ilContextSoap"),
41  array(ilContextExtended::CONTEXT_WEBDAV,"ilContextWebdav"),
42  array(ilContextExtended::CONTEXT_RSS_AUTH,"ilContextRssAuth"),
43  array(ilContextExtended::CONTEXT_SESSION_REMINDER,"ilContextSessionReminder"),
44  array(ilContextExtended::CONTEXT_SOAP_WITHOUT_CLIENT,"ilContextSoapWithoutClient"),
45  array(ilContextExtended::CONTEXT_UNITTEST,"ilContextUnitTest"),
46  array(ilContextExtended::CONTEXT_REST,"ilContextRest"),
47  array(ilContextExtended::CONTEXT_SCORM,"ilContextScorm"),
48  array(ilContextExtended::CONTEXT_WAC,"ilContextWAC"));
49  }
50 }
const CONTEXT_WAC
$context
Definition: webdav.php:26
static getClassName()
Get context className.
const CONTEXT_RSS
const CONTEXT_WEBDAV
const CONTEXT_UNITTEST
const CONTEXT_CRON
const CONTEXT_SCORM
const CONTEXT_RSS_AUTH
testInit($context, $className)
test init ilContext
const CONTEXT_SESSION_REMINDER
const CONTEXT_REST
const CONTEXT_ICAL
const CONTEXT_SOAP_WITHOUT_CLIENT
static init($a_type)
Init context by type.
const CONTEXT_WEB
static getType()
Get context type.
const CONTEXT_SOAP
TestCase for the ilContext.