1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 21:24:02 +00:00

Add tests that satisfy the ArrayIterator branch

This commit is contained in:
Mark 2024-12-29 08:55:03 +01:00
parent 633f1703a0
commit 06b17354af
No known key found for this signature in database
GPG key ID: 79CFF7869BD39873

View file

@ -23,6 +23,11 @@ it('the in method checks for presence in an array', function () {
expect(Status::PENDING->in([Status::PENDING, Status::DONE]))->toBeTrue(); expect(Status::PENDING->in([Status::PENDING, Status::DONE]))->toBeTrue();
expect(Role::ADMIN->in([Role::ADMIN]))->toBeTrue(); expect(Role::ADMIN->in([Role::ADMIN]))->toBeTrue();
$iterator = new ArrayIterator([Status::PENDING, Status::DONE]);
expect(Status::PENDING->in($iterator))->toBeTrue();
expect(Status::DONE->in($iterator))->toBeTrue();
expect(Status::PENDING->in(new ArrayIterator([Role::ADMIN, Role::GUEST])))->toBeFalse();
expect(Status::PENDING->in([Status::DONE]))->toBeFalse(); expect(Status::PENDING->in([Status::DONE]))->toBeFalse();
expect(Status::PENDING->in([Role::ADMIN, Role::GUEST]))->toBeFalse(); expect(Status::PENDING->in([Role::ADMIN, Role::GUEST]))->toBeFalse();
}); });