<?php namespace Tests\Unit; use PHPUnit\Framework\TestCase; use App\Services\IpMatcher; class IpMatcherTest extends TestCase { public function test_exact_ip_matches():void{$m=new IpMatcher; $this->assertTrue($m->matches('127.0.0.1','127.0.0.1'));$this->assertFalse($m->matches('127.0.0.2','127.0.0.1'));} public function test_ipv4_cidr_matches():void{$m=new IpMatcher;$this->assertTrue($m->matches('192.168.1.50','192.168.1.0/24'));$this->assertFalse($m->matches('192.168.2.1','192.168.1.0/24'));} public function test_ipv6_cidr_matches():void{$m=new IpMatcher;$this->assertTrue($m->matches('2001:db8::1','2001:db8::/32'));$this->assertFalse($m->matches('2001:db9::1','2001:db8::/32'));} }