Skip to content

Commit 2de9978

Browse files
test(FreeRADIUSClient): validate entire addr field so labels are populated
This fixes an issue where the labels referenced by validate_addr were missing and prevented validation from working correctly.
1 parent 3ec45ee commit 2de9978

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFreeRADIUSClientTestCase.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,17 @@ class APIModelsFreeRADIUSClientTestCase extends TestCase {
9292
response_id: 'FREERADIUS_CLIENT_ADDR_IPV4_NOT_ALLOWED',
9393
code: 400,
9494
callable: function () {
95-
$client = new FreeRADIUSClient(ip_version: 'ipv6addr');
95+
$client = new FreeRADIUSClient(addr: "1.2.3.4", ip_version: 'ipv6addr');
96+
$client->addr->validate(); # Validate to so labels are populated
9697
$client->validate_addr('1.2.3.4');
9798
},
9899
);
99100
$this->assert_throws_response(
100101
response_id: 'FREERADIUS_CLIENT_ADDR_IPV6_NOT_ALLOWED',
101102
code: 400,
102103
callable: function () {
103-
$client = new FreeRADIUSClient(ip_version: 'ipaddr');
104+
$client = new FreeRADIUSClient(addr: "1234::1", ip_version: 'ipaddr');
105+
$client->addr->validate(); # Validate to so labels are populated
104106
$client->validate_addr('1234::1');
105107
},
106108
);

0 commit comments

Comments
 (0)