-
Notifications
You must be signed in to change notification settings - Fork 11
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
1cc8b9e
commit fa595f1
Showing
6 changed files
with
81 additions
and
33 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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
/vendor | ||
composer.lock | ||
phpunit.xml | ||
.phpunit.result.cache | ||
build | ||
|
||
## Directory-based project format: | ||
.idea/ |
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 |
---|---|---|
@@ -1,38 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"> | ||
<coverage> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
<report> | ||
<html outputDirectory="build/coverage"/> | ||
<text outputFile="build/coverage.txt"/> | ||
</report> | ||
</coverage> | ||
|
||
<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="Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log | ||
type="coverage-html" | ||
target="build/coverage" | ||
/> | ||
<php> | ||
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/> | ||
|
||
<log | ||
type="coverage-text" | ||
target="build/coverage.txt" | ||
/> | ||
</logging> | ||
<env name="ODBC_DSN" value=""/> | ||
<env name="ODBC_HOST" value=""/> | ||
<env name="ODBC_DB" value=""/> | ||
<env name="ODBC_USERNAME" value=""/> | ||
<env name="ODBC_PASSWORD" value=""/> | ||
<env name="ODBC_TEST_SELECT" value=""/> | ||
</php> | ||
</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,19 @@ | ||
<?php | ||
|
||
namespace Dbt\Odbc\Tests; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
|
||
class ConnectionTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function getting_the_connection (): void | ||
{ | ||
|
||
|
||
$result = DB::connection('odbc') | ||
->select(config('database.test_select')); | ||
|
||
$this->assertNotNull($result); | ||
} | ||
} |
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,35 @@ | ||
<?php | ||
|
||
namespace Dbt\Odbc\Tests; | ||
|
||
use Dbt\Odbc\Provider; | ||
use Illuminate\Config\Repository; | ||
use Orchestra\Testbench\TestCase as Orchestra; | ||
|
||
class TestCase extends Orchestra | ||
{ | ||
protected function setUp (): void | ||
{ | ||
parent::setUp(); | ||
|
||
$config = $this->app->make(Repository::class); | ||
|
||
$config->set('database.connections', [ | ||
'odbc' => [ | ||
'driver' => 'odbc', | ||
'dsn' => env('ODBC_DSN'), | ||
'host' => env('ODBC_HOST'), | ||
'database' => env('ODBC_DB'), | ||
'username' => env('ODBC_USERNAME'), | ||
'password' => env('ODBC_PASSWORD'), | ||
], | ||
]); | ||
|
||
$config->set('database.test_select', env('ODBC_TEST_SELECT')); | ||
} | ||
|
||
protected function getPackageProviders ($app): array | ||
{ | ||
return [Provider::class]; | ||
} | ||
} |