ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Style\Content\Access\test\IncidentTest Class Reference
+ Inheritance diagram for ILIAS\Style\Content\Access\test\IncidentTest:
+ Collaboration diagram for ILIAS\Style\Content\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\Style\Content\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\Style\Content\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\Style\Content\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\Style\Content\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: