Skip to content

Commit 0cc3b04

Browse files
style: run prettier on changed files
1 parent feb0bfb commit 0cc3b04

File tree

3 files changed

+40
-41
lines changed

3 files changed

+40
-41
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Endpoints/ServicesFreeRADIUSInterfacesEndpoint.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use RESTAPI\Core\Endpoint;
1212
*/
1313
class ServicesFreeRADIUSInterfacesEndpoint extends Endpoint {
1414
public function __construct() {
15-
# Set Endpoint attributes
15+
# Set Endpoint attributes
1616
$this->url = '/api/v2/services/freeradius/interfaces';
1717
$this->model_name = 'FreeRADIUSInterface';
1818
$this->many = true;

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

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class APIModelsFreeRADIUSClientTestCase extends TestCase {
1515
# Create a new FreeRADIUSClient
1616
$client = new FreeRADIUSClient(
1717
addr: '1.2.3.4',
18-
ip_version: "ipaddr",
19-
shortname: "testclient",
20-
secret: "testsecret",
18+
ip_version: 'ipaddr',
19+
shortname: 'testclient',
20+
secret: 'testsecret',
2121
proto: 'udp',
2222
nastype: 'dot1x',
2323
msgauth: false,
@@ -30,34 +30,33 @@ class APIModelsFreeRADIUSClientTestCase extends TestCase {
3030
$raddb = file_get_contents('/usr/local/etc/raddb/clients.conf');
3131
$this->assert_str_contains($raddb, 'client "testclient" {');
3232
$this->assert_str_contains($raddb, 'ipaddr = 1.2.3.4');
33-
$this->assert_str_contains($raddb, "proto = udp");
34-
$this->assert_str_contains($raddb, "nas_type = dot1x");
35-
$this->assert_str_contains($raddb, "login = testlogin");
36-
$this->assert_str_contains($raddb, "password = testpassword");
37-
$this->assert_str_contains($raddb, "require_message_authenticator = no");
33+
$this->assert_str_contains($raddb, 'proto = udp');
34+
$this->assert_str_contains($raddb, 'nas_type = dot1x');
35+
$this->assert_str_contains($raddb, 'login = testlogin');
36+
$this->assert_str_contains($raddb, 'password = testpassword');
37+
$this->assert_str_contains($raddb, 'require_message_authenticator = no');
3838
$this->assert_str_contains($raddb, 'max_connections = 16');
3939

40-
4140
# Ensure we can read the created user from the config
4241
$read_client = new FreeRADIUSClient(id: $client->id);
43-
$this->assert_equals($read_client->addr->value, "1.2.3.4");
44-
$this->assert_equals($read_client->ip_version->value, "ipaddr");
45-
$this->assert_equals($read_client->shortname->value, "testclient");
46-
$this->assert_str_contains($read_client->proto->value, "udp");
47-
$this->assert_str_contains($read_client->nastype->value, "dot1x");
42+
$this->assert_equals($read_client->addr->value, '1.2.3.4');
43+
$this->assert_equals($read_client->ip_version->value, 'ipaddr');
44+
$this->assert_equals($read_client->shortname->value, 'testclient');
45+
$this->assert_str_contains($read_client->proto->value, 'udp');
46+
$this->assert_str_contains($read_client->nastype->value, 'dot1x');
4847
$this->assert_equals($read_client->msgauth->value, false);
4948
$this->assert_equals($read_client->maxconn->value, 16);
50-
$this->assert_equals($read_client->naslogin->value, "testlogin");
51-
$this->assert_equals($read_client->naspassword->value, "testpassword");
52-
$this->assert_equals($read_client->description->value, "Test client");
49+
$this->assert_equals($read_client->naslogin->value, 'testlogin');
50+
$this->assert_equals($read_client->naspassword->value, 'testpassword');
51+
$this->assert_equals($read_client->description->value, 'Test client');
5352

5453
# Ensure we can update the user
5554
$client = new FreeRADIUSClient(
5655
id: $read_client->id,
5756
addr: '4321::1',
58-
ip_version: "ipv6addr",
59-
shortname: "newtestclient",
60-
secret: "newtestsecret",
57+
ip_version: 'ipv6addr',
58+
shortname: 'newtestclient',
59+
secret: 'newtestsecret',
6160
proto: 'tcp',
6261
nastype: 'cisco',
6362
msgauth: true,
@@ -71,11 +70,11 @@ class APIModelsFreeRADIUSClientTestCase extends TestCase {
7170
$this->assert_str_does_not_contain($raddb, 'client "testclient" {');
7271
$this->assert_str_contains($raddb, 'client "newtestclient" {');
7372
$this->assert_str_contains($raddb, 'ipaddr = 4321::1');
74-
$this->assert_str_contains($raddb, "proto = tcp");
75-
$this->assert_str_contains($raddb, "nas_type = cisco");
76-
$this->assert_str_contains($raddb, "login = newtestlogin");
77-
$this->assert_str_contains($raddb, "password = newtestpassword");
78-
$this->assert_str_contains($raddb, "require_message_authenticator = yes");
73+
$this->assert_str_contains($raddb, 'proto = tcp');
74+
$this->assert_str_contains($raddb, 'nas_type = cisco');
75+
$this->assert_str_contains($raddb, 'login = newtestlogin');
76+
$this->assert_str_contains($raddb, 'password = newtestpassword');
77+
$this->assert_str_contains($raddb, 'require_message_authenticator = yes');
7978
$this->assert_str_contains($raddb, 'max_connections = 32');
8079

8180
# Delete the user and ensure it is removed from the database
@@ -90,30 +89,30 @@ class APIModelsFreeRADIUSClientTestCase extends TestCase {
9089
*/
9190
public function test_ip_version_mismatch(): void {
9291
$this->assert_throws_response(
93-
response_id: "FREERADIUS_CLIENT_ADDR_IPV4_NOT_ALLOWED",
92+
response_id: 'FREERADIUS_CLIENT_ADDR_IPV4_NOT_ALLOWED',
9493
code: 400,
9594
callable: function () {
96-
$client = new FreeRADIUSClient(ip_version: "ipv6addr");
97-
$client->validate_addr("1.2.3.4");
98-
}
95+
$client = new FreeRADIUSClient(ip_version: 'ipv6addr');
96+
$client->validate_addr('1.2.3.4');
97+
},
9998
);
10099
$this->assert_throws_response(
101-
response_id: "FREERADIUS_CLIENT_ADDR_IPV6_NOT_ALLOWED",
100+
response_id: 'FREERADIUS_CLIENT_ADDR_IPV6_NOT_ALLOWED',
102101
code: 400,
103102
callable: function () {
104-
$client = new FreeRADIUSClient(ip_version: "ipaddr");
105-
$client->validate_addr("1234::1");
106-
}
103+
$client = new FreeRADIUSClient(ip_version: 'ipaddr');
104+
$client->validate_addr('1234::1');
105+
},
107106
);
108107

109108
# Ensure * is always allowed
110109
$this->assert_does_not_throw(
111110
callable: function () {
112-
$client = new FreeRADIUSClient(ip_version: "ipaddr");
113-
$client->validate_addr("*");
114-
$client = new FreeRADIUSClient(ip_version: "ipv6addr");
115-
$client->validate_addr("*");
116-
}
111+
$client = new FreeRADIUSClient(ip_version: 'ipaddr');
112+
$client->validate_addr('*');
113+
$client = new FreeRADIUSClient(ip_version: 'ipv6addr');
114+
$client->validate_addr('*');
115+
},
117116
);
118117
}
119118
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ class APIModelsSystemTimezoneTestCase extends TestCase {
1616

1717
# Ensure the timezone was updated correctly
1818
$zoneinfo = file_get_contents('/var/db/zoneinfo');
19-
$this->assert_equals($zoneinfo, 'America/Denver'.PHP_EOL);
19+
$this->assert_equals($zoneinfo, 'America/Denver' . PHP_EOL);
2020

2121
# Update the timezone again
2222
$timezone = new SystemTimezone(timezone: 'UTC');
2323
$timezone->update();
2424

2525
# Ensure the timezone was updated correctly
2626
$zoneinfo = file_get_contents('/var/db/zoneinfo');
27-
$this->assert_equals($zoneinfo, 'UTC'.PHP_EOL);
27+
$this->assert_equals($zoneinfo, 'UTC' . PHP_EOL);
2828
}
2929

3030
/**

0 commit comments

Comments
 (0)