ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
assBaseTestCase.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
8{
12 protected function setUp()
13 {
14 $GLOBALS['DIC'] = new \ILIAS\DI\Container();
15
16 parent::setUp();
17 }
18
23 protected function setGlobalVariable($name, $value)
24 {
25 global $DIC;
26
27 $GLOBALS[$name] = $value;
28
29 unset($DIC[$name]);
31 }
32
36 protected function getGlobalTemplateMock()
37 {
38 return $this->getMockBuilder(\ilTemplate::class)->disableOriginalConstructor()->getMock();
39 }
40
44 protected function getDatabaseMock()
45 {
46 return $this->getMockBuilder(\ilDBInterface::class)->disableOriginalConstructor()->getMock();
47 }
48
52 protected function getIliasMock()
53 {
54 $mock = $this->getMockBuilder(\ILIAS::class)->disableOriginalConstructor()->getMock();
55
56 $account = new stdClass();
57 $account->id = 6;
58 $account->fullname = 'Esther Tester';
59
60 $mock->account = $account;
61
62 return $mock;
63 }
64}
An exception for terminatinating execution or to throw for unit testing.
Class assBaseTestCase.
setGlobalVariable($name, $value)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
global $DIC
Definition: saml.php:7