toBeIpAddress() ->and('::1')->toBeIpAddress() ->and('2001:db8::1')->toBeIpAddress(); }); test('failures', function (): void { expect('not-an-ip')->toBeIpAddress(); })->throws(ExpectationFailedException::class); test('failures with invalid type', function (): void { expect([])->toBeIpAddress(); })->throws(InvalidExpectationValue::class, 'Invalid expectation value type. Expected [string].'); test('failures with custom message', function (): void { expect('not-an-ip')->toBeIpAddress('oh no!'); })->throws(ExpectationFailedException::class, 'oh no!'); test('not failures', function (): void { expect('192.168.1.1')->not->toBeIpAddress(); })->throws(ExpectationFailedException::class);