-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55844ce
commit aaf37c2
Showing
4 changed files
with
96 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="Softink Lab Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace SoftinkLab\LaravelKeyvalueStorage\Test; | ||
|
||
use SoftinkLab\LaravelKeyvalueStorage\Facades\KVOption; | ||
use SoftinkLab\LaravelKeyvalueStorage\KeyValueStorageServiceProvider; | ||
use Orchestra\Testbench\TestCase; | ||
|
||
abstract class FacadeTest extends TestsCase | ||
{ | ||
/** | ||
* Define environment setup. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return void | ||
*/ | ||
protected function getEnvironmentSetUp($app) | ||
{ | ||
// Setup default database to use sqlite :memory: | ||
$app['config']->set('database.default', 'testbench'); | ||
|
||
$app['config']->set( | ||
'database.connections.testbench', | ||
[ | ||
'driver' => 'sqlite', | ||
'database' => ':memory:', | ||
'prefix' => '', | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Setup the test environment. | ||
*/ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); | ||
} | ||
|
||
/** | ||
* Get package providers. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageProviders($app) | ||
{ | ||
return [ | ||
KeyValueStorageServiceProvider::class, | ||
]; | ||
} | ||
|
||
/** | ||
* Get package aliases. | ||
* | ||
* @param \Illuminate\Foundation\Application $app | ||
* | ||
* @return array | ||
*/ | ||
protected function getPackageAliases($app) | ||
{ | ||
return [ | ||
'KVOption' => KVOption::class, | ||
]; | ||
} | ||
} |