-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor singleton trait and adding more provider unit tests
- Loading branch information
Enrique Perez
committed
Aug 3, 2017
1 parent
c0e3e1e
commit deeee29
Showing
14 changed files
with
390 additions
and
57 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
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
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
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
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
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
14 changes: 12 additions & 2 deletions
14
src/Providers/AbstractProvider.php → src/Providers/Traits/Singleton.php
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
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
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,28 @@ | ||
<?php | ||
|
||
namespace GhostIO\Tests\Mocks; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Dummy Classes | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This classes will serve as helpers for the API response so we mock it | ||
| and we dont actually go and send a request to the real server. | ||
| | ||
*/ | ||
|
||
class ResponseBodyDummy | ||
{ | ||
private $contents; | ||
|
||
public function getContents() | ||
{ | ||
return $this->contents; | ||
} | ||
|
||
public function setContents(array $contents) | ||
{ | ||
$this->contents = json_encode($contents); | ||
} | ||
} |
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,30 @@ | ||
<?php | ||
|
||
namespace GhostIO\Tests\Mocks; | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Dummy Classes | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This classes will serve as helpers for the API response so we mock it | ||
| and we dont actually go and send a request to the real server. | ||
| | ||
*/ | ||
|
||
class ResponseDummy | ||
{ | ||
private $body; | ||
|
||
public function getBody() | ||
{ | ||
return $this->body; | ||
} | ||
|
||
public function setResponseBody(array $body) | ||
{ | ||
$responseBody = new ResponseBodyDummy(); | ||
$responseBody->setContents($body); | ||
$this->body = $responseBody; | ||
} | ||
} |
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
Oops, something went wrong.