assertTrue(UserRepository::ispChanged('Comcast', 0, 'Verizon')); } public function testFirstDetectionAgainstNullDescPersists(): void { // No ISP stored yet -> a detected ISP counts as changed. $this->assertTrue(UserRepository::ispChanged('Comcast', 0, null)); } // ── the bug: a GeoIP miss must not reach the persist branch ── public function testGeoipMissDoesNotPersist(): void { $this->assertFalse(UserRepository::ispChanged(null, 0, 'Verizon'), 'null con_isp_name'); $this->assertFalse(UserRepository::ispChanged('', 0, 'Verizon'), 'empty con_isp_name'); } // ── no write when nothing actually changed ── public function testUnchangedIspDoesNotPersist(): void { $this->assertFalse(UserRepository::ispChanged('Comcast', 0, 'Comcast')); $this->assertFalse(UserRepository::ispChanged('Comcast', 0, 'comcast'), 'case-insensitive'); $this->assertFalse(UserRepository::ispChanged('COMCAST', 0, 'comcast')); } // ── a line already flagged in violation is left alone ── public function testViolationDoesNotPersist(): void { $this->assertFalse(UserRepository::ispChanged('Comcast', 1, 'Verizon')); } }