19declare(strict_types=1);
24use PHPUnit\Framework\TestCase;
39 $this->assertEquals(self::VALID_POINTS_1, $obj->getPoints());
40 $this->assertEquals(self::VALID_STATUS_1, $obj->getStatus());
48 }
catch (InvalidArgumentException
$e) {
49 $this->assertTrue(
true);
58 }
catch (InvalidArgumentException
$e) {
59 $this->assertTrue(
true);
68 }
catch (InvalidArgumentException
$e) {
69 $this->assertTrue(
true);
77 $new = $obj->withPoints(self::VALID_POINTS_2);
79 $this->assertEquals(self::VALID_POINTS_1, $obj->getPoints());
80 $this->assertEquals(self::VALID_POINTS_2, $new->getPoints());
88 $obj->withPoints(self::INVALID_POINTS);
90 }
catch (InvalidArgumentException
$e) {
91 $this->assertTrue(
true);
99 $new = $obj->withStatus(self::VALID_STATUS_2);
101 $this->assertEquals(self::VALID_STATUS_1, $obj->getStatus());
102 $this->assertEquals(self::VALID_STATUS_2, $new->getStatus());
110 $obj->withStatus(self::INVALID_STATUS);
112 }
catch (InvalidArgumentException
$e) {
113 $this->assertTrue(
true);
119 $lng = $this->createMock(ilLanguage::class);
134 $lng_consecutive_calls = [];
135 $lng->expects($this->atLeastOnce())
137 ->willReturnCallback(
138 function (
$txt) use (&$lng_consecutive_calls) {
139 $lng_consecutive_calls[] =
$txt;
144 $expected_consecutive_calls = [
150 'prg_status_outdated',
155 $field = $obj->toFormInput(
161 $this->assertEquals($expected_consecutive_calls, $lng_consecutive_calls);
163 $this->assertInstanceOf(
170 $this->assertInstanceOf(
175 $this->assertInstanceOf(
testFailCreateWithInvalidPointAndInvalidStatus()
testFailCreateWithInvalidPoints()
testFailCreateWithInvalidStatus()
testSuccessfulWithPoints()
testSuccessfulWithStatus()
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.