-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add native Lumen support * add missing bindings to the container * change deprecated ServiceBuilder to StorageClient * add travis
- Loading branch information
1 parent
86ce73a
commit 8a7ffa9
Showing
5 changed files
with
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: php | ||
sudo: false | ||
php: | ||
- '7.0' | ||
- '7.1' | ||
|
||
install: | ||
- composer install --no-interaction --prefer-source | ||
- composer require laravel/lumen-framework | ||
|
||
script: | ||
- php vendor/bin/phpunit |
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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="./vendor/autoload.php" colors="true" forceCoversAnnotation="false"> | ||
<testsuites> | ||
<testsuite name="lumen-support test suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter processUncoveredFilesFromWhitelist="true"> | ||
<whitelist> | ||
<directory suffix=".php">src</directory> | ||
<exclude> | ||
<directory>tests</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |
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,62 @@ | ||
<?php | ||
|
||
namespace Websight\GcsProvider\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Laravel\Lumen\Application; | ||
use Illuminate\Config\Repository; | ||
use Websight\GcsProvider\CloudStorageServiceProvider; | ||
|
||
class LumenSupportTest extends TestCase | ||
{ | ||
/** | ||
* @var Application | ||
*/ | ||
protected $app; | ||
|
||
/** | ||
* @var CloudStorageServiceProvider | ||
*/ | ||
protected $provider; | ||
|
||
public function setUp() | ||
{ | ||
if (!class_exists(Application::class)) { | ||
$this->markTestSkipped(); | ||
} | ||
|
||
$this->app = $this->setupApplication(); | ||
$this->provider = $this->setupServiceProvider($this->app); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
protected function setupApplication() | ||
{ | ||
$app = new Application(sys_get_temp_dir()); | ||
$app->instance('config', new Repository()); | ||
|
||
$app->withFacades(); | ||
|
||
return $app; | ||
} | ||
|
||
protected function setupServiceProvider(Application $app) | ||
{ | ||
$provider = new CloudStorageServiceProvider($app); | ||
$app->register($provider); | ||
$provider->boot(); | ||
|
||
return $provider; | ||
} | ||
|
||
public function testFacadeIsExists() | ||
{ | ||
$this->assertTrue(class_exists('Storage')); | ||
} | ||
|
||
public function testRequiredProvidersAreRegistered() | ||
{ | ||
$this->assertTrue($this->app->has('filesystem')); | ||
} | ||
} |