Skip to content

Commit

Permalink
Implement Identifiable Interface [#26]
Browse files Browse the repository at this point in the history
Closes #26
  • Loading branch information
levidurfee committed Nov 29, 2018
2 parents 67dfeb5 + bd12b77 commit 19210a7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@
<testsuite name="FileCreation">
<file>tests/FileCreationTest.php</file>
</testsuite>
<testsuite name="General">
<file>tests/GeneralTest.php</file>
</testsuite>
</testsuites>
<filter>
<whitelist>
Expand Down
5 changes: 3 additions & 2 deletions src/Contracts/ResourceInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace Bulldog\Strype\Contracts;

interface ResourceInterface
use Bulldog\Strype\Contracts\Support\Identifiable;

interface ResourceInterface extends Identifiable
{
public function getId(): string;
}
8 changes: 8 additions & 0 deletions src/Contracts/Support/Identifiable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace Bulldog\Strype\Contracts\Support;

interface Identifiable
{
public function getId(): string;
}
17 changes: 17 additions & 0 deletions tests/GeneralTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Strype;

class GeneralTest extends TestCase
{
public function testCustomerImplementsInterfaces()
{
$customer = $this->strype->customer()->create('levi@example.com', 'tok_mastercard');
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\Support\Identifiable);
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\ResourceInterface);
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\Traits\DeleteInterface);
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\Traits\UpdateInterface);
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\Traits\ListAllInterface);
$this->assertTrue($customer instanceof \Bulldog\Strype\Contracts\Traits\RetrieveInterface);
}
}

0 comments on commit 19210a7

Please sign in to comment.