ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
ilLSPostConditionTest.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
21
use
PHPUnit\Framework\TestCase
;
22
23
class
ilLSPostConditionTest
extends
TestCase
24
{
25
public
function
testObjectCreation
(): void
26
{
27
$obj =
new
ilLSPostCondition
(33,
'always'
);
28
29
$this->assertInstanceOf(ilLSPostCondition::class, $obj);
30
$this->assertEquals(33, $obj->getRefId());
31
$this->assertEquals(
'always'
, $obj->getConditionOperator());
32
$this->assertNull($obj->getValue());
33
}
34
35
public
function
testWithConditionOperator
(): void
36
{
37
$obj =
new
ilLSPostCondition
(23,
'always'
,
'15'
);
38
$new_obj = $obj->withConditionOperator(
'failed'
);
39
40
$this->assertEquals(23, $obj->getRefId());
41
$this->assertEquals(
'always'
, $obj->getConditionOperator());
42
$this->assertEquals(
'15'
, $obj->getValue());
43
44
$this->assertEquals(23, $new_obj->getRefId());
45
$this->assertEquals(
'failed'
, $new_obj->getConditionOperator());
46
$this->assertEquals(
'15'
, $new_obj->getValue());
47
}
48
49
public
function
testWithValue
(): void
50
{
51
$obj =
new
ilLSPostCondition
(45,
'not_finished'
,
'15'
);
52
$new_obj = $obj->withValue(
'22'
);
53
54
$this->assertEquals(45, $obj->getRefId());
55
$this->assertEquals(
'not_finished'
, $obj->getConditionOperator());
56
$this->assertEquals(
'15'
, $obj->getValue());
57
58
$this->assertEquals(45, $new_obj->getRefId());
59
$this->assertEquals(
'not_finished'
, $new_obj->getConditionOperator());
60
$this->assertEquals(
'22'
, $new_obj->getValue());
61
}
62
}
ilLSPostConditionTest\testObjectCreation
testObjectCreation()
Definition:
ilLSPostConditionTest.php:25
ilLSPostConditionTest
Definition:
ilLSPostConditionTest.php:23
ilLSPostCondition
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilLSPostCondition.php:28
ilLSPostConditionTest\testWithValue
testWithValue()
Definition:
ilLSPostConditionTest.php:49
TestCase
ilLSPostConditionTest\testWithConditionOperator
testWithConditionOperator()
Definition:
ilLSPostConditionTest.php:35
Modules
LearningSequence
test
PostConditions
ilLSPostConditionTest.php
Generated on Wed Sep 3 2025 22:01:33 for ILIAS by
1.8.13 (using
Doxyfile
)