File tree Expand file tree Collapse file tree
pfSense-pkg-RESTAPI/files/etc/inc/RESTAPI/Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class APIModelsWakeOnLANSendTestCase extends TestCase
4242 * Checks that the _create() method throws an error if the wol command fails for any reason.
4343 */
4444 public function test_error_thrown_if_wol_cmd_fails (): void {
45+ # Ensure an error is thrown if the wol command fails (i.e. the mac address is somehow invalid, etc.)
4546 $ this ->assert_throws_response (
4647 response_id: "WAKE_ON_LAN_SEND_COMMAND_FAILED " ,
4748 code: 500 ,
@@ -52,5 +53,15 @@ class APIModelsWakeOnLANSendTestCase extends TestCase
5253 $ wol ->_create ();
5354 }
5455 );
56+
57+ # Ensure no error is thrown when the wol command is successful
58+ $ this ->assert_does_not_throw (
59+ callable: function () {
60+ $ wol = new WakeOnLANSend ();
61+ $ wol ->interface ->value = "lan " ;
62+ $ wol ->mac_addr ->value = "00:00:00:00:00:00 " ;
63+ $ wol ->_create ();
64+ }
65+ );
5566 }
5667}
You can’t perform that action at this time.
0 commit comments