Last active
April 10, 2018 18:39
-
-
Save viirre/64750fd70560bdf4090433e4c8d44e02 to your computer and use it in GitHub Desktop.
Test #1 - make SomeService testable without actually making any https calls
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
<?php | |
class SomeService | |
{ | |
public function callApi() | |
{ | |
$apiClass = new ApiClass; | |
$result = $apiClass->call('fetch'); | |
// Handle result | |
} | |
} | |
class ApiClass { | |
public function call($method) | |
{ | |
// Makes external http call | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment