ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilTestEvaluationExceptionTest Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestEvaluationExceptionTest:
+ Collaboration diagram for ilTestEvaluationExceptionTest:

Public Member Functions

 testConstruct (array $input, array $output)
 
 testException (array $input, array $output)
 
- Public Member Functions inherited from ilTestBaseTestCase
 createInstanceOf (string $class_name, array $explicit_parameters=[])
 
 createTraitInstanceOf (string $class_name, array $explicit_parameters=[])
 

Static Public Member Functions

static constructDataProvider ()
 
static exceptionDataProvider ()
 
- Static Public Member Functions inherited from ilTestBaseTestCase
static callMethod ($obj, $name, array $args=[])
 
static getNonPublicPropertyValue (object $obj, string $name)
 

Additional Inherited Members

- Data Fields inherited from ilTestBaseTestCase
const string MOCKED_METHOD_WITHOUT_OUTPUT = 'MOCKED_METHOD_WITHOUT_OUTPUT'
 
const string DYNAMIC_CLASS = 'DynamicClass'
 
- Protected Member Functions inherited from ilTestBaseTestCase
 setUp ()
 
 tearDown ()
 
- Protected Attributes inherited from ilTestBaseTestCase
Container $dic = null
 
Container $backup_dic = null
 
- Static Protected Attributes inherited from ilTestBaseTestCase
static int $DYNAMIC_CLASS_COUNT = 0
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file ilTestEvaluationExceptionTest.php.

Member Function Documentation

◆ constructDataProvider()

static ilTestEvaluationExceptionTest::constructDataProvider ( )
static

Definition at line 33 of file ilTestEvaluationExceptionTest.php.

33  : array
34  {
35  return [
36  [['msg' => '', 'code' => -1], ['msg' => ilTestEvaluationException::class, 'code' => -1]],
37  [['msg' => '', 'code' => 0], ['msg' => ilTestEvaluationException::class, 'code' => 0]],
38  [['msg' => '', 'code' => 1], ['msg' => ilTestEvaluationException::class, 'code' => 1]],
39  [['msg' => ''], ['msg' => ilTestEvaluationException::class, 'code' => 0]],
40  [['msg' => 'test', 'code' => -1], ['msg' => 'test', 'code' => -1]],
41  [['msg' => 'test', 'code' => 0], ['msg' => 'test', 'code' => 0]],
42  [['msg' => 'test', 'code' => 1], ['msg' => 'test', 'code' => 1]],
43  [['msg' => 'test'], ['msg' => 'test', 'code' => 0]]
44  ];
45  }

◆ exceptionDataProvider()

static ilTestEvaluationExceptionTest::exceptionDataProvider ( )
static

Definition at line 59 of file ilTestEvaluationExceptionTest.php.

59  : array
60  {
61  return [
62  [['msg' => '', 'code' => -1], ['msg' => ilTestEvaluationException::class, 'code' => -1]],
63  [['msg' => '', 'code' => 0], ['msg' => ilTestEvaluationException::class, 'code' => 0]],
64  [['msg' => '', 'code' => 1], ['msg' => ilTestEvaluationException::class, 'code' => 1]],
65  [['msg' => ''], ['msg' => ilTestEvaluationException::class, 'code' => 0]],
66  [['msg' => 'test', 'code' => -1], ['msg' => 'test', 'code' => -1]],
67  [['msg' => 'test', 'code' => 0], ['msg' => 'test', 'code' => 0]],
68  [['msg' => 'test'], ['msg' => 'test', 'code' => 0]]
69  ];
70  }

◆ testConstruct()

ilTestEvaluationExceptionTest::testConstruct ( array  $input,
array  $output 
)

Definition at line 22 of file ilTestEvaluationExceptionTest.php.

22  : void
23  {
24  $ilTestEvaluationException = isset($input['code'])
25  ? new ilTestEvaluationException($input['msg'], $input['code'])
26  : new ilTestEvaluationException($input['msg'])
27  ;
28  $this->assertInstanceOf(ilTestEvaluationException::class, $ilTestEvaluationException);
29  $this->assertEquals($output['msg'], $ilTestEvaluationException->getMessage());
30  $this->assertEquals($output['code'], $ilTestEvaluationException->getCode());
31  }

◆ testException()

ilTestEvaluationExceptionTest::testException ( array  $input,
array  $output 
)

Definition at line 48 of file ilTestEvaluationExceptionTest.php.

48  : void
49  {
50  $this->expectException(ilTestEvaluationException::class);
51  $this->expectExceptionMessage($output['msg']);
52  $this->expectExceptionCode($output['code']);
53  throw isset($input['code'])
54  ? new ilTestEvaluationException($input['msg'], $input['code'])
55  : new ilTestEvaluationException($input['msg'])
56  ;
57  }

The documentation for this class was generated from the following file: