@@ -20,7 +20,7 @@ public function setUp(): void
2020 parent ::setUp ();
2121 $ tmp = new Zones ($ this ->hetznerApi ->getHttpClient ());
2222
23- $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone.json ' )));
23+ $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone.json ' )));
2424 $ this ->zone = $ tmp ->getById (4711 );
2525 }
2626
@@ -37,15 +37,15 @@ public function testDelete()
3737
3838 public function testUpdate ()
3939 {
40- $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone.json ' )));
40+ $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone.json ' )));
4141 $ this ->zone ->update (['name ' => 'new-name ' ]);
4242 $ this ->assertLastRequestEquals ('PUT ' , '/zones/4711 ' );
4343 $ this ->assertLastRequestBodyParametersEqual (['name ' => 'new-name ' ]);
4444 }
4545
4646 public function testChangeProtection ()
4747 {
48- $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone_action_change_protection.json ' )));
48+ $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone_action_change_protection.json ' )));
4949 $ apiResponse = $ this ->zone ->changeProtection (true );
5050 $ this ->assertEquals ('change_protection ' , $ apiResponse ->action ->command );
5151 $ this ->assertEquals ($ this ->zone ->id , $ apiResponse ->action ->resources [0 ]->id );
@@ -68,38 +68,37 @@ public function testChangeTTL()
6868 public function testImportZonefile ()
6969 {
7070 $ this ->mockHandler ->append (new Response (200 , [], $ this ->getGenericActionResponse ('import_zonefile ' )));
71- $ apiResponse = $ this ->zone ->importZonefile (" zonefile_content " );
71+ $ apiResponse = $ this ->zone ->importZonefile (' zonefile_content ' );
7272 $ this ->assertEquals ('import_zonefile ' , $ apiResponse ->action ->command );
7373 $ this ->assertEquals ($ this ->zone ->id , $ apiResponse ->action ->resources [0 ]->id );
7474 $ this ->assertEquals ('zone ' , $ apiResponse ->action ->resources [0 ]->type );
7575 $ this ->assertLastRequestEquals ('POST ' , '/zones/4711/actions/import_zonefile ' );
76- $ this ->assertLastRequestBodyParametersEqual (['zonefile ' => " zonefile_content " ]);
76+ $ this ->assertLastRequestBodyParametersEqual (['zonefile ' => ' zonefile_content ' ]);
7777 }
7878
7979 public function testTestChangePrimaryNameservers ()
8080 {
8181 $ this ->mockHandler ->append (new Response (200 , [], $ this ->getGenericActionResponse ('import_zonefile ' )));
8282 $ apiResponse = $ this ->zone ->changePrimaryNameservers ([
83- new PrimaryNameserver (" 192.168.178.1 " , 53 )
83+ new PrimaryNameserver (' 192.168.178.1 ' , 53 ),
8484 ]);
8585 $ this ->assertEquals ('import_zonefile ' , $ apiResponse ->action ->command );
8686 $ this ->assertEquals ($ this ->zone ->id , $ apiResponse ->action ->resources [0 ]->id );
8787 $ this ->assertEquals ('zone ' , $ apiResponse ->action ->resources [0 ]->type );
8888 $ this ->assertLastRequestEquals ('POST ' , '/zones/4711/actions/change_primary_nameservers ' );
89- $ this ->assertLastRequestBodyParametersEqual (['primary_nameservers ' => [[" address " => " 192.168.178.1 " , " port " => 53 ]]]);
89+ $ this ->assertLastRequestBodyParametersEqual (['primary_nameservers ' => [[' address ' => ' 192.168.178.1 ' , ' port ' => 53 ]]]);
9090 }
9191
92-
9392 public function testExportZonefile ()
9493 {
95- $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone_zonefile.json ' )));
94+ $ this ->mockHandler ->append (new Response (200 , [], file_get_contents (__DIR__ . '/fixtures/zone_zonefile.json ' )));
9695 $ apiResponse = $ this ->zone ->exportZonefile ();
9796 $ this ->assertNotEmpty ($ apiResponse ->zonefile );
9897 $ this ->assertLastRequestEquals ('GET ' , '/zones/4711/zonefile ' );
9998 }
10099
101100 protected function getGenericActionResponse (string $ command )
102101 {
103- return str_replace ('$command ' , $ command , file_get_contents (__DIR__ . '/fixtures/zone_action_generic.json ' ));
102+ return str_replace ('$command ' , $ command , file_get_contents (__DIR__ . '/fixtures/zone_action_generic.json ' ));
104103 }
105104}
0 commit comments