-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
- Loading branch information
Showing
6 changed files
with
70 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
|
||
namespace Katsana\Tests; | ||
|
||
use Katsana\Manager; | ||
|
||
class ManagerTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_has_proper_signature() | ||
{ | ||
config(['services.katsana' => [ | ||
'environment' => 'carbon', | ||
]]); | ||
|
||
$stub = $this->app['katsana.manager']; | ||
|
||
$this->assertSame('laravel', $stub->getDefaultDriver()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_use_laravel_driver() | ||
{ | ||
config(['services.katsana' => [ | ||
'client_id' => static::CLIENT_ID, | ||
'client_secret' => static::CLIENT_SECRET, | ||
'access_token' => static::ACCESS_TOKEN, | ||
'environment' => 'carbon', | ||
]]); | ||
|
||
$stub = $this->app['katsana.manager']->driver('laravel'); | ||
|
||
$this->assertSame(static::CLIENT_ID, $stub->getClientId()); | ||
$this->assertSame(static::CLIENT_SECRET, $stub->getClientSecret()); | ||
$this->assertSame(static::ACCESS_TOKEN, $stub->getAccessToken()); | ||
|
||
$this->assertSame('https://carbon.api.katsana.com', $stub->getApiEndpoint()); | ||
} | ||
|
||
/** @test */ | ||
public function it_can_use_sdk_driver() | ||
{ | ||
config(['services.katsana' => [ | ||
'client_id' => static::CLIENT_ID, | ||
'client_secret' => static::CLIENT_SECRET, | ||
'access_token' => static::ACCESS_TOKEN, | ||
'environment' => 'carbon', | ||
]]); | ||
|
||
$stub = $this->app['katsana.manager']->driver('sdk'); | ||
|
||
$this->assertNull($stub->getClientId()); | ||
$this->assertNull($stub->getClientSecret()); | ||
$this->assertNull($stub->getAccessToken()); | ||
|
||
$this->assertSame('https://carbon.api.katsana.com', $stub->getApiEndpoint()); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Katsana\TestCase; | ||
namespace Katsana\Tests; | ||
|
||
use Katsana\Katsana; | ||
use Katsana\ServiceProvider; | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Katsana\TestCase; | ||
namespace Katsana\Tests; | ||
|
||
use Orchestra\Testbench\TestCase as Testbench; | ||
|
||
|