ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Test\Access\test\IncidentTest Class Reference
+ Inheritance diagram for ILIAS\Test\Access\test\IncidentTest:
+ Collaboration diagram for ILIAS\Test\Access\test\IncidentTest:

Public Member Functions

 testConstruct ()
 
 testAny ()
 
 testAnyBreaksAtFirstTrue ()
 
 testAnyReturnsFalse ()
 

Detailed Description

Definition at line 27 of file IncidentTest.php.

Member Function Documentation

◆ testAny()

ILIAS\Test\Access\test\IncidentTest::testAny ( )

Definition at line 34 of file IncidentTest.php.

34 : void
35 {
36 $this->assertTrue((new Incident())->any(static fn(int $x) => $x === 2, [1, 2, 3]));
37 }

◆ testAnyBreaksAtFirstTrue()

ILIAS\Test\Access\test\IncidentTest::testAnyBreaksAtFirstTrue ( )

Definition at line 39 of file IncidentTest.php.

39 : void
40 {
41 $throw_error = false;
42
43 $this->assertTrue((new Incident())->any(static function (int $x) use (&$throw_error): bool {
44 if ($throw_error) {
45 throw new Exception('Should not be called anymore.');
46 }
47 return $x === 2 && ($throw_error = true);
48 }, [1, 2, 3]));
49 }

◆ testAnyReturnsFalse()

ILIAS\Test\Access\test\IncidentTest::testAnyReturnsFalse ( )

Definition at line 51 of file IncidentTest.php.

51 : void
52 {
53 $this->assertFalse((new Incident())->any(static fn(int $x) => false, [1, 2, 3]));
54 }

◆ testConstruct()

ILIAS\Test\Access\test\IncidentTest::testConstruct ( )

Definition at line 29 of file IncidentTest.php.

29 : void
30 {
31 $this->assertInstanceOf(Incident::class, new Incident());
32 }

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