-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added default environment specification to ForteClient
- Loading branch information
Showing
4 changed files
with
63 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,18 +12,16 @@ | |
* Abstract class for SubResource(s) | ||
* | ||
* @author Sam Anthony <[email protected]> | ||
* @author Jacob Thomason <[email protected]> | ||
*/ | ||
abstract class AbstractSubResource | ||
{ | ||
|
||
/** @var ForteEnvironment */ | ||
private $forteEnvironment; | ||
private ForteEnvironment $forteEnvironment; | ||
|
||
|
||
/** | ||
* Constructor | ||
* | ||
* @param ForteEnvironment $forteEnvironment | ||
*/ | ||
public function __construct(ForteEnvironment $forteEnvironment) | ||
{ | ||
|
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 |
---|---|---|
|
@@ -4,17 +4,20 @@ | |
|
||
namespace Rentpost\ForteApi\Test\Integration; | ||
|
||
use Rentpost\ForteApi\Attribute as Attribute; | ||
use Rentpost\ForteApi\Attribute; | ||
use Rentpost\ForteApi\Client\ForteClient; | ||
use Rentpost\ForteApi\Exception\LibraryGenericException; | ||
use Rentpost\ForteApi\File\Logger\Factory as FileLoggerFactory; | ||
use Rentpost\ForteApi\HttpClient\HttpClient; | ||
use Rentpost\ForteApi\Test\AbstractTestCase; | ||
use Rentpost\ForteApi\Void\Logger as VoidLogger; | ||
use Rentpost\ForteApi\File\Logger\Factory as FileLoggerFactory; | ||
use Symfony\Component\Yaml\Yaml; | ||
use Rentpost\ForteApi\Test\UserSettings; | ||
use Rentpost\Sprocket\Environment\Detective; | ||
use Rentpost\ForteApi\Void\Logger as VoidLogger; | ||
|
||
/** | ||
* Base Integration Test Class | ||
* | ||
* @author Sam Anthony <[email protected]> | ||
* @author Jacob Thomason <[email protected]> | ||
*/ | ||
abstract class AbstractIntegrationTest extends AbstractTestCase | ||
{ | ||
|
||
|
@@ -24,16 +27,17 @@ protected function getAllSettingsFromFile(): array | |
} | ||
|
||
|
||
/** | ||
* Gets the ForteClient | ||
*/ | ||
protected function getForteClient(): ForteClient | ||
{ | ||
$logDir = UserSettings::getLogLocation(); | ||
$logger = (new FileLoggerFactory($logDir))->make('forte'); | ||
|
||
$allSettings = $this->getAllSettingsFromFile(); | ||
|
||
$forteClient = (new \Rentpost\ForteApi\Client\Factory())->make($allSettings, $logger); | ||
|
||
return $forteClient; | ||
return (new \Rentpost\ForteApi\Client\Factory())->make($allSettings, $logger, 'sandbox'); | ||
} | ||
|
||
|
||
|
@@ -53,7 +57,7 @@ protected function getDirectHttpClient(string $baseUrl): HttpClient | |
new Attribute\Id\OrganizationId($settings['authenticating_organization_id']), | ||
$baseUrl, | ||
new VoidLogger(), | ||
$settings['debug'] | ||
$settings['debug'], | ||
); | ||
} | ||
} |