Skip to content

Commit

Permalink
Merge pull request DigitalOceanPHP#144 from yassirh/master
Browse files Browse the repository at this point in the history
Preparing for release
  • Loading branch information
yassirh authored Sep 12, 2016
2 parents d7e6b73 + 49a0507 commit d7fc80c
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 64 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
CHANGELOG
=========

2.1.1 (Not released yet)
2.1.1 (12/09/2016)
------------------

- Added support for Volumes (Block Storage)
- Added the size_gigabytes attribute to images
- Added the posibility to page through droplets - PR #141
- Improved the update method for domain records - PR #142

2.1.0 (2015-12-22)
------------------
Expand Down
16 changes: 8 additions & 8 deletions spec/DigitalOceanV2/Api/ActionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

class ActionSpec extends \PhpSpec\ObjectBehavior
{
function let(AdapterInterface $adapter)
public function let(AdapterInterface $adapter)
{
$this->beConstructedWith($adapter);
}

function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('DigitalOceanV2\Api\Action');
}

function it_returns_an_empty_array($adapter)
public function it_returns_an_empty_array($adapter)
{
$adapter->get('https://api.digitalocean.com/v2/actions?per_page=200')->willReturn('{"actions": []}');

Expand All @@ -26,7 +26,7 @@ function it_returns_an_empty_array($adapter)
$actions->shouldHaveCount(0);
}

function it_returns_an_array_of_action_entity($adapter)
public function it_returns_an_array_of_action_entity($adapter)
{
$total = 3;
$adapter
Expand Down Expand Up @@ -105,7 +105,7 @@ function it_returns_an_array_of_action_entity($adapter)
$meta->total->shouldBe($total);
}

function it_returns_an_action_entity_get_by_its_id($adapter)
public function it_returns_an_action_entity_get_by_its_id($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/actions/123')
Expand Down Expand Up @@ -139,12 +139,12 @@ function it_returns_an_action_entity_get_by_its_id($adapter)
$this->getMeta()->shouldBeNull();
}

function it_throws_an_http_exception_if_requested_action_does_not_exist($adapter)
public function it_throws_an_http_exception_if_requested_action_does_not_exist($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/actions/123456789123456789')
->get('https://api.digitalocean.com/v2/actions/1234567')
->willThrow(new HttpException('Request not processed.'));

$this->shouldThrow(new HttpException('Request not processed.'))->duringGetById(123456789123456789);
$this->shouldThrow(new HttpException('Request not processed.'))->duringGetById(1234567);
}
}
78 changes: 39 additions & 39 deletions spec/DigitalOceanV2/Api/DropletSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

class DropletSpec extends \PhpSpec\ObjectBehavior
{
function let(AdapterInterface $adapter)
public function let(AdapterInterface $adapter)
{
$this->beConstructedWith($adapter);
}

function it_is_initializable()
public function it_is_initializable()
{
$this->shouldHaveType('DigitalOceanV2\Api\Droplet');
}

function it_returns_an_empty_array($adapter)
public function it_returns_an_empty_array($adapter)
{
$adapter->get('https://api.digitalocean.com/v2/droplets?per_page=200&page=1')->willReturn('{"droplets": []}');

Expand All @@ -26,7 +26,7 @@ function it_returns_an_empty_array($adapter)
$droplets->shouldHaveCount(0);
}

function it_returns_an_array_of_droplet_entity($adapter)
public function it_returns_an_array_of_droplet_entity($adapter)
{
$total = 3;
$adapter
Expand All @@ -44,7 +44,7 @@ function it_returns_an_array_of_droplet_entity($adapter)
$meta->total->shouldBe($total);
}

function it_returns_an_array_of_droplet_neighbors_for_a_given_droplet_id($adapter)
public function it_returns_an_array_of_droplet_neighbors_for_a_given_droplet_id($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/droplets/123/neighbors')
Expand All @@ -58,7 +58,7 @@ function it_returns_an_array_of_droplet_neighbors_for_a_given_droplet_id($adapte
}
}

function it_returns_an_array_of_upgrade_entity($adapter)
public function it_returns_an_array_of_upgrade_entity($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/droplet_upgrades')
Expand All @@ -72,7 +72,7 @@ function it_returns_an_array_of_upgrade_entity($adapter)
}
}

function it_returns_an_array_of_droplet_that_are_running_on_the_same_physical_hardware($adapter)
public function it_returns_an_array_of_droplet_that_are_running_on_the_same_physical_hardware($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/reports/droplet_neighbors')
Expand All @@ -86,7 +86,7 @@ function it_returns_an_array_of_droplet_that_are_running_on_the_same_physical_ha
}
}

function it_returns_a_droplet_entity_get_by_its_id($adapter)
public function it_returns_a_droplet_entity_get_by_its_id($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/droplets/14')
Expand Down Expand Up @@ -174,8 +174,8 @@ function it_returns_a_droplet_entity_get_by_its_id($adapter)
$droplet->kernel->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Kernel');
$droplet->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
$droplet->image->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Image');
$droplet->volumeIds[0]->shouldBe("123321123");
$droplet->volumeIds[1]->shouldBe("789987789");
$droplet->volumeIds[0]->shouldBe('123321123');
$droplet->volumeIds[1]->shouldBe('789987789');
$this->getMeta()->shouldBeNull();
$droplet->sizeSlug->shouldBe('512mb');
$droplet->backupsEnabled->shouldBe(true);
Expand All @@ -185,7 +185,7 @@ function it_returns_a_droplet_entity_get_by_its_id($adapter)
$droplet->nextBackupWindow->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\NextBackupWindow');
}

function it_returns_a_droplet_entity_even_if_backup_is_disabled($adapter)
public function it_returns_a_droplet_entity_even_if_backup_is_disabled($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/droplets/1234')
Expand Down Expand Up @@ -245,16 +245,16 @@ function it_returns_a_droplet_entity_even_if_backup_is_disabled($adapter)
$droplet->nextBackupWindow->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\NextBackupWindow');
}

function it_throws_an_http_exception_if_requested_droplet_does_not_exist($adapter)
public function it_throws_an_http_exception_if_requested_droplet_does_not_exist($adapter)
{
$adapter
->get('https://api.digitalocean.com/v2/droplets/123456789123456789')
->get('https://api.digitalocean.com/v2/droplets/1234567')
->willThrow(new HttpException('Request not processed.'));

$this->shouldThrow(new HttpException('Request not processed.'))->duringGetById(123456789123456789);
$this->shouldThrow(new HttpException('Request not processed.'))->duringGetById(1234567);
}

function it_returns_the_created_droplet_entity_without_ssh_keys($adapter)
public function it_returns_the_created_droplet_entity_without_ssh_keys($adapter)
{
$adapter
->post(
Expand All @@ -266,7 +266,7 @@ function it_returns_the_created_droplet_entity_without_ssh_keys($adapter)
$this->create('foo', 'nyc1', '512mb', 123456)->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Droplet');
}

function it_returns_the_created_droplet_entity_with_ssh_keys($adapter)
public function it_returns_the_created_droplet_entity_with_ssh_keys($adapter)
{
$adapter
->post(
Expand All @@ -280,7 +280,7 @@ function it_returns_the_created_droplet_entity_with_ssh_keys($adapter)
->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Droplet');
}

function can_create_multiple_droplets_at_the_same_time($adapter)
public function can_create_multiple_droplets_at_the_same_time($adapter)
{
$adapter
->post(
Expand All @@ -292,7 +292,7 @@ function can_create_multiple_droplets_at_the_same_time($adapter)
$this->create(['foo', 'bar'], 'nyc1', '512mb', 123456)->shouldReturn(null);
}

function it_throws_an_http_exception_if_not_possible_to_create_a_droplet($adapter)
public function it_throws_an_http_exception_if_not_possible_to_create_a_droplet($adapter)
{
$adapter
->post(
Expand All @@ -304,7 +304,7 @@ function it_throws_an_http_exception_if_not_possible_to_create_a_droplet($adapte
$this->shouldThrow(new HttpException('Request not processed.'))->duringCreate('foo', 'nyc1', '512mb', 123456);
}

function it_deletes_the_droplet_and_returns_nothing($adapter)
public function it_deletes_the_droplet_and_returns_nothing($adapter)
{
$adapter
->delete('https://api.digitalocean.com/v2/droplets/123')
Expand All @@ -313,7 +313,7 @@ function it_deletes_the_droplet_and_returns_nothing($adapter)
$this->delete(123);
}

function it_throws_an_http_exception_when_trying_to_delete_inexisting_droplet($adapter)
public function it_throws_an_http_exception_when_trying_to_delete_inexisting_droplet($adapter)
{
$adapter
->delete('https://api.digitalocean.com/v2/droplets/123')
Expand All @@ -322,7 +322,7 @@ function it_throws_an_http_exception_when_trying_to_delete_inexisting_droplet($a
$this->shouldThrow(new HttpException('Request not processed.'))->duringDelete(123);
}

function it_returns_an_array_of_droplets_kernel_entity($adapter)
public function it_returns_an_array_of_droplets_kernel_entity($adapter)
{
$total = 3;
$adapter
Expand All @@ -340,7 +340,7 @@ function it_returns_an_array_of_droplets_kernel_entity($adapter)
$meta->total->shouldBe($total);
}

function it_returns_an_array_of_droplets_snapshots_which_are_image_entity($adapter)
public function it_returns_an_array_of_droplets_snapshots_which_are_image_entity($adapter)
{
$total = 3;
$adapter
Expand All @@ -358,7 +358,7 @@ function it_returns_an_array_of_droplets_snapshots_which_are_image_entity($adapt
$meta->total->shouldBe($total);
}

function it_returns_an_array_of_droplets_backup_which_are_image_entity($adapter)
public function it_returns_an_array_of_droplets_backup_which_are_image_entity($adapter)
{
$total = 3;
$adapter
Expand All @@ -375,7 +375,7 @@ function it_returns_an_array_of_droplets_backup_which_are_image_entity($adapter)
$meta->total->shouldBe($total);
}

function it_returns_an_array_of_droplets_action_entity($adapter)
public function it_returns_an_array_of_droplets_action_entity($adapter)
{
$total = 3;
$adapter
Expand All @@ -394,7 +394,7 @@ function it_returns_an_array_of_droplets_action_entity($adapter)
$meta->total->shouldBe($total);
}

function it_returns_the_given_droplets_action_get_by_its_id($adapter)
public function it_returns_the_given_droplets_action_get_by_its_id($adapter)
{
$adapter->get('https://api.digitalocean.com/v2/droplets/123/actions/456')->willReturn('{"action": {"region": {}}}');

Expand All @@ -403,7 +403,7 @@ function it_returns_the_given_droplets_action_get_by_its_id($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_reboot($adapter)
public function it_returns_the_action_entity_after_reboot($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'reboot'])
Expand All @@ -414,7 +414,7 @@ function it_returns_the_action_entity_after_reboot($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_power_cycle($adapter)
public function it_returns_the_action_entity_after_power_cycle($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'power_cycle'])
Expand All @@ -425,7 +425,7 @@ function it_returns_the_action_entity_after_power_cycle($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_shutdown($adapter)
public function it_returns_the_action_entity_after_shutdown($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'shutdown'])
Expand All @@ -436,7 +436,7 @@ function it_returns_the_action_entity_after_shutdown($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_power_off($adapter)
public function it_returns_the_action_entity_after_power_off($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'power_off'])
Expand All @@ -447,7 +447,7 @@ function it_returns_the_action_entity_after_power_off($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_power_on($adapter)
public function it_returns_the_action_entity_after_power_on($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'power_on'])
Expand All @@ -458,7 +458,7 @@ function it_returns_the_action_entity_after_power_on($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_password_reset($adapter)
public function it_returns_the_action_entity_after_password_reset($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'password_reset'])
Expand All @@ -469,7 +469,7 @@ function it_returns_the_action_entity_after_password_reset($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_resize($adapter)
public function it_returns_the_action_entity_after_resize($adapter)
{
$adapter
->post(
Expand All @@ -483,7 +483,7 @@ function it_returns_the_action_entity_after_resize($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_restore($adapter)
public function it_returns_the_action_entity_after_restore($adapter)
{
$adapter
->post(
Expand All @@ -497,7 +497,7 @@ function it_returns_the_action_entity_after_restore($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_rebuild($adapter)
public function it_returns_the_action_entity_after_rebuild($adapter)
{
$adapter
->post(
Expand All @@ -511,7 +511,7 @@ function it_returns_the_action_entity_after_rebuild($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_changing_kernel($adapter)
public function it_returns_the_action_entity_after_changing_kernel($adapter)
{
$adapter
->post(
Expand All @@ -525,7 +525,7 @@ function it_returns_the_action_entity_after_changing_kernel($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_ipv6_enabled($adapter)
public function it_returns_the_action_entity_after_ipv6_enabled($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'enable_ipv6'])
Expand All @@ -536,7 +536,7 @@ function it_returns_the_action_entity_after_ipv6_enabled($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_backups_are_enabled($adapter)
public function it_returns_the_action_entity_after_backups_are_enabled($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'enable_backups'])
Expand All @@ -547,7 +547,7 @@ function it_returns_the_action_entity_after_backups_are_enabled($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_backups_are_disabled($adapter)
public function it_returns_the_action_entity_after_backups_are_disabled($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'disable_backups'])
Expand All @@ -558,7 +558,7 @@ function it_returns_the_action_entity_after_backups_are_disabled($adapter)
$action->region->shouldReturnAnInstanceOf('DigitalOceanV2\Entity\Region');
}

function it_returns_the_action_entity_after_enabling_private_network($adapter)
public function it_returns_the_action_entity_after_enabling_private_network($adapter)
{
$adapter
->post('https://api.digitalocean.com/v2/droplets/123/actions', ['type' => 'enable_private_networking'])
Expand Down
Loading

0 comments on commit d7fc80c

Please sign in to comment.