@@ -106,7 +106,7 @@ public function testInvalidIpAddressAndNetmask(string|\Stringable $cidr)
106
106
/**
107
107
* @dataProvider getOutOfRangeNetmask
108
108
*/
109
- public function testOutOfRangeNetmask (string $ cidr , ?string $ version = null , ?int $ min = null , ?int $ max = null )
109
+ public function testOutOfRangeNetmask (string $ cidr , int $ maxExpected , ?string $ version = null , ?int $ min = null , ?int $ max = null )
110
110
{
111
111
$ cidrConstraint = new Cidr ([
112
112
'version ' => $ version ,
@@ -118,7 +118,7 @@ public function testOutOfRangeNetmask(string $cidr, ?string $version = null, ?in
118
118
$ this
119
119
->buildViolation ('The value of the netmask should be between {{ min }} and {{ max }}. ' )
120
120
->setParameter ('{{ min }} ' , $ cidrConstraint ->netmaskMin )
121
- ->setParameter ('{{ max }} ' , $ cidrConstraint -> netmaskMax )
121
+ ->setParameter ('{{ max }} ' , $ maxExpected )
122
122
->setCode (Cidr::OUT_OF_RANGE_ERROR )
123
123
->assertRaised ();
124
124
}
@@ -240,9 +240,9 @@ public static function getWithInvalidMasksAndIps(): array
240
240
public static function getOutOfRangeNetmask (): array
241
241
{
242
242
return [
243
- ['10.0.0.0/24 ' , Ip::V4 , 10 , 20 ],
244
- ['10.0.0.0/128 ' ],
245
- ['2001:0DB8:85A3:0000:0000:8A2E:0370:7334/24 ' , Ip::V6 , 10 , 20 ],
243
+ ['10.0.0.0/24 ' , 20 , Ip::V4 , 10 , 20 ],
244
+ ['10.0.0.0/128 ' , 32 ],
245
+ ['2001:0DB8:85A3:0000:0000:8A2E:0370:7334/24 ' , 20 , Ip::V6 , 10 , 20 ],
246
246
];
247
247
}
248
248
0 commit comments