-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c574040
commit 07f957c
Showing
4 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace spec\PlanetHoster\Api; | ||
|
||
use PlanetHoster\Api\Domain; | ||
use PlanetHoster\Adapter\Adapter; | ||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
|
||
class DomainSpec extends ObjectBehavior | ||
{ | ||
|
||
function let(Adapter $adapter) | ||
{ | ||
$this->beConstructedWith($adapter); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(Domain::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace spec\PlanetHoster\Api; | ||
|
||
use PlanetHoster\Api\World; | ||
use PlanetHoster\Adapter\Adapter; | ||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
|
||
class WorldSpec extends ObjectBehavior | ||
{ | ||
|
||
function let(Adapter $adapter) | ||
{ | ||
$this->beConstructedWith($adapter); | ||
} | ||
|
||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(World::class); | ||
} | ||
|
||
function it_should_return_accounts(Adapter $adapter) | ||
{ | ||
$adapter->get('/world-api/get-accounts') | ||
->willReturn(' | ||
{ | ||
"nb_active_or_suspended_accounts":5, | ||
"total_available_ressources":{ | ||
"cpu":177, | ||
"mem":482, | ||
"io":482 | ||
}, | ||
"world_accounts":[], | ||
"reseller_id":"a1b2c3" | ||
} | ||
'); | ||
|
||
$accounts = $this->GetAccounts(); | ||
$accounts->shouldReturnAnInstanceOf('stdClass'); | ||
$accounts->world_accounts->shouldBeArray(); | ||
$accounts->world_accounts->shouldHaveCount(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace spec\PlanetHoster\Entity; | ||
|
||
use PlanetHoster\Entity\DnsRecord; | ||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
|
||
class DnsRecordSpec extends ObjectBehavior | ||
{ | ||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(DnsRecord::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace spec\PlanetHoster\Entity; | ||
|
||
use PlanetHoster\Entity\DomainContact; | ||
use PhpSpec\ObjectBehavior; | ||
use Prophecy\Argument; | ||
|
||
class DomainContactSpec extends ObjectBehavior | ||
{ | ||
function it_is_initializable() | ||
{ | ||
$this->shouldHaveType(DomainContact::class); | ||
} | ||
} |