Skip to content

Commit

Permalink
Reformatting again
Browse files Browse the repository at this point in the history
  • Loading branch information
rathalos64 committed Apr 12, 2017
1 parent d32fbea commit df2961e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 38 deletions.
22 changes: 11 additions & 11 deletions src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
56 changes: 29 additions & 27 deletions tests/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand All @@ -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)
{
Expand Down

0 comments on commit df2961e

Please sign in to comment.