Commit 14305686 authored by Stas's avatar Stas Committed by Jens Segers

use env values from phpunit.xml, update database.php and queue.php (#1738)

* use env values from phpunit.xml, update database.php and queue.php

* Add .editorconfig

* Update QueueTest.php

* Update phpunit.xml.dist

* Use in casting instead intval
parent e2a8fae1
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
\ No newline at end of file
......@@ -15,31 +15,40 @@
<directory>tests/</directory>
</testsuite>
<testsuite name="schema">
<directory>tests/SchemaTest.php</directory>
<file>tests/SchemaTest.php</file>
</testsuite>
<testsuite name="seeder">
<directory>tests/SeederTest.php</directory>
<file>tests/SeederTest.php</file>
</testsuite>
<testsuite name="cache">
<directory>tests/CacheTest.php</directory>
<file>tests/CacheTest.php</file>
</testsuite>
<testsuite name="builder">
<directory>tests/QueryBuilderTest.php</directory>
<directory>tests/QueryTest.php</directory>
<file>tests/QueryBuilderTest.php</file>
<file>tests/QueryTest.php</file>
</testsuite>
<testsuite name="model">
<directory>tests/ModelTest.php</directory>
<directory>tests/RelationsTest.php</directory>
<file>tests/ModelTest.php</file>
<file>tests/RelationsTest.php</file>
</testsuite>
<testsuite name="relations">
<directory>tests/RelationsTest.php</directory>
<directory>tests/EmbeddedRelationsTest.php</directory>
<file>tests/RelationsTest.php</file>
<file>tests/EmbeddedRelationsTest.php</file>
</testsuite>
<testsuite name="mysqlrelations">
<directory>tests/RelationsTest.php</directory>
<file>tests/RelationsTest.php</file>
</testsuite>
<testsuite name="validation">
<directory>tests/ValidationTest.php</directory>
<file>tests/ValidationTest.php</file>
</testsuite>
</testsuites>
<php>
<env name="MONGO_HOST" value="mongodb"/>
<env name="MONGO_DATABASE" value="unittest"/>
<env name="MONGO_PORT" value="27017"/>
<env name="MYSQL_HOST" value="mysql"/>
<env name="MYSQL_DATABASE" value="unittest"/>
<env name="MYSQL_USERNAME" value="root"/>
<env name="QUEUE_CONNECTION" value="database"/>
</php>
</phpunit>
<?php
$mongoHost = env('MONGO_HOST', 'mongodb');
$mongoPort = env('MONGO_PORT') ? (int) env('MONGO_PORT') : 27017;
return [
'connections' => [
......@@ -7,21 +10,21 @@ return [
'mongodb' => [
'name' => 'mongodb',
'driver' => 'mongodb',
'host' => 'mongodb',
'database' => 'unittest',
'host' => $mongoHost,
'database' => env('MONGO_DATABASE', 'unittest'),
],
'dsn_mongodb' => [
'driver' => 'mongodb',
'dsn' => 'mongodb://mongodb:27017',
'database' => 'unittest',
'dsn' => "mongodb://$mongoHost:$mongoPort",
'database' => env('MONGO_DATABASE', 'unittest'),
],
'mysql' => [
'driver' => 'mysql',
'host' => 'mysql',
'database' => 'unittest',
'username' => 'root',
'host' => env('MYSQL_HOST', 'mysql'),
'database' => env('MYSQL_DATABASE', 'unittest'),
'username' => env('MYSQL_USERNAME', 'root'),
'password' => '',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
......
......@@ -2,7 +2,7 @@
return [
'default' => 'database',
'default' => env('QUEUE_CONNECTION'),
'connections' => [
......@@ -16,7 +16,7 @@ return [
],
'failed' => [
'database' => 'mongodb',
'database' => env('MONGO_DATABASE'),
'table' => 'failed_jobs',
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment