Skip to content

Commit f41a954

Browse files
test(NetworkInterface): fix broken NetworkInterface tests
1 parent c34558f commit f41a954

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsNetworkInterfaceTestCase.inc‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ class APIModelsNetworkInterfaceTestCase extends TestCase {
881881
* Checks that a NEW descr value violating filter-name rules is rejected
882882
* (FilterNameValidator now runs in validate_descr for changed values).
883883
*/
884-
public function test_descr_new_value_rejects_reserved_name() {
884+
public function test_descr_new_value_rejects_reserved_name(): void {
885885
$this->assert_throws_response(
886886
response_id: 'FILTER_NAME_VALIDATOR_RESERVED_NAME_USED',
887887
code: 400,
@@ -899,7 +899,7 @@ class APIModelsNetworkInterfaceTestCase extends TestCase {
899899
* revalidates every field on PATCH; validating an unchanged value
900900
* locked whole interfaces whose descr predates the rules).
901901
*/
902-
public function test_descr_unchanged_legacy_value_not_revalidated() {
902+
public function test_descr_unchanged_legacy_value_not_revalidated(): void {
903903
$this->assert_does_not_throw(
904904
callable: function () {
905905
$test_model = new NetworkInterface();
@@ -921,12 +921,13 @@ class APIModelsNetworkInterfaceTestCase extends TestCase {
921921
* Checks that dhcp6_ia_pd_len accepts the GUI choices ('none' and the
922922
* 16..0 IA-PD lengths) and rejects out-of-set values.
923923
*/
924-
public function test_dhcp6_ia_pd_len_choices() {
924+
public function test_dhcp6_ia_pd_len_choices(): void {
925925
$this->assert_does_not_throw(
926926
callable: function () {
927927
$test_model = new NetworkInterface();
928928
$test_model->typev6->value = 'dhcp6';
929929
$test_model->dhcp6_ia_pd_len->value = '0';
930+
$test_model->dhcp6_ia_pd_len->validate();
930931
},
931932
);
932933

@@ -935,6 +936,7 @@ class APIModelsNetworkInterfaceTestCase extends TestCase {
935936
$test_model = new NetworkInterface();
936937
$test_model->typev6->value = 'dhcp6';
937938
$test_model->dhcp6_ia_pd_len->value = 'none';
939+
$test_model->dhcp6_ia_pd_len->validate();
938940
},
939941
);
940942

@@ -945,6 +947,7 @@ class APIModelsNetworkInterfaceTestCase extends TestCase {
945947
$test_model = new NetworkInterface();
946948
$test_model->typev6->value = 'dhcp6';
947949
$test_model->dhcp6_ia_pd_len->value = '999';
950+
$test_model->dhcp6_ia_pd_len->validate();
948951
},
949952
);
950953
}

0 commit comments

Comments
 (0)