19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
30 $this->assertInstanceOf(Incident::class,
new Incident());
36 $this->assertTrue($incident->any(
static function (
int $x) {
return $x === 2;}, [1, 2, 3]));
44 $this->assertTrue($incident->any(
static function (
int $x) use (&$throw_error):
bool {
46 throw new Exception(
'Should not be called anymore.');
58 $this->assertFalse($incident->any(
static function (
int $x) {
return false;}, [1, 2, 3]));
An exception for terminatinating execution or to throw for unit testing.
testAnyBreaksAtFirstTrue()