From df2961eff74ea7d3176b65ee217a78f8c55dedc8 Mon Sep 17 00:00:00 2001 From: rathalos64 Date: Wed, 12 Apr 2017 16:33:24 +0200 Subject: [PATCH] Reformatting again --- src/API.php | 22 +++++++++--------- tests/UserTest.php | 56 ++++++++++++++++++++++++---------------------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/API.php b/src/API.php index f1a3148..72745c4 100644 --- a/src/API.php +++ b/src/API.php @@ -14,12 +14,12 @@ use Exception; /** - * The official Nimbusec API client written in PHP. + * The official Nimbusec API client written in PHP. * It uses the GuzzleHttp Library to communicate with the Nimbusec API via SSL and the OAuth standard to get the required authentification. - * - * All objects being passed as method parameters must be non-JSON associative arrays as they'll be encoded / decoded and later on send to the server within the method. - * Otherwise an exception will be thrown. - * + * + * All objects being passed as method parameters must be non-JSON associative arrays as they'll be encoded / decoded and later on send to the server within the method. + * Otherwise an exception will be thrown. + * * Please note that this API client may not be complete as for the possible operations described in the Nimbusec API documentation. The API client will be expanded when additional features are needed. * See the documentation for more details. */ @@ -79,8 +79,8 @@ private function toFullURL($path, $trailing = false) * Issues the API to create the given domain. * * @param array $domain The given domain. - * @param boolean $upsert Optional. When set to true, creating an already existing domain will not result in an error. - * Instead, it will update the existing domain with the new fields. + * @param boolean $upsert Optional. When set to true, creating an already existing domain will not result in an error. + * Instead, it will update the existing domain with the new fields. * @return array The created (or updated) domain. */ public function createDomain(array $domain, $upsert = false) @@ -141,7 +141,7 @@ public function findDomains($filter = null) * Issues the API to update a given domain. * * @param integer $id The id of the domain which should be updated. - * @param array $domain The new domain containing all fields which should be updated. + * @param array $domain The new domain containing all fields which should be updated. * @return array The updated domain. */ public function updateDomain($id, array $domain) @@ -310,8 +310,8 @@ public function findBundles($filter = null) * Issues the API to create the given user. * * @param array $user The given user. - * @param boolean $upsert Optional. When set to true, creating an already existing user will not result in an error. - * Instead, it will update the existing user with the new fields. + * @param boolean $upsert Optional. When set to true, creating an already existing user will not result in an error. + * Instead, it will update the existing user with the new fields. * @return array The created (or updated) user. */ public function createUser(array $user, $upsert = false) @@ -372,7 +372,7 @@ public function findUsers($filter = null) * Issues the API to update a given user. * * @param integer $id The id of the user which should be updated. - * @param array $user The new user containing all fields which should be updated. + * @param array $user The new user containing all fields which should be updated. * @return array The updated user. */ public function updateUser($id, array $user) diff --git a/tests/UserTest.php b/tests/UserTest.php index 4b01ea9..865b998 100644 --- a/tests/UserTest.php +++ b/tests/UserTest.php @@ -98,11 +98,11 @@ public function testFindUserConfigurations(array $user) public function testSetUserConfiguration(array $user) { $conf = $this->api->setUserConfiguration($user["id"], "language", "de"); - $this->assertEquals("de", $conf); + $this->assertEquals("de", $conf); return $user; } - /** + /** * @depends testUpdateUser */ public function testFindSpecificUserConfiguration(array $user) @@ -120,9 +120,9 @@ public function testDeleteUserConfiguration(array $user) $this->assertNull($this->api->deleteUserConfiguration($user["id"], "language")); } - // ========================================= [ USER DOMAIN SET ] ========================================= - - /** + // ========================================= [ USER DOMAIN SET ] ========================================= + + /** * @depends testUpdateUser */ public function testCreateDomain() @@ -133,40 +133,42 @@ public function testCreateDomain() return $created; } - /** + /** * @depends testUpdateUser - * @depends testCreateDomain + * @depends testCreateDomain */ - public function testCreateDomainSet($user, $domain) { - $set = $this->api->createDomainSet($user["id"], $domain["id"]); - $this->assertInternalType("array", $set); - $this->assertNotEmpty($set); - return array($user, $domain); - } - - /** - * @depends testCreateDomainSet + public function testCreateDomainSet($user, $domain) + { + $set = $this->api->createDomainSet($user["id"], $domain["id"]); + $this->assertInternalType("array", $set); + $this->assertNotEmpty($set); + return array($user, $domain); + } + + /** + * @depends testCreateDomainSet */ - public function testDeleteFromDomainSet(array $args) { - list($user, $domain) = $args; - $this->assertNull($this->api->deleteFromDomainSet($user["id"], $domain["id"])); - return $domain; - } + public function testDeleteFromDomainSet(array $args) + { + list($user, $domain) = $args; + $this->assertNull($this->api->deleteFromDomainSet($user["id"], $domain["id"])); + return $domain; + } - // ========================================= [ TEAR DOWN ] ========================================= + // ========================================= [ TEAR DOWN ] ========================================= - /** - * @depends testDeleteFromDomainSet - */ + /** + * @depends testDeleteFromDomainSet + */ public function testDeleteDomain(array $domain) { $this->assertNull($this->api->deleteDomain($domain["id"])); } - /** + /** * @depends testUpdateUser * @depends testDeleteUserConfiguration - * @depends testDeleteDomain + * @depends testDeleteDomain */ public function testDeleteUser(array $updated) {