Compare commits
2
Commits
d1981673a2
...
f2bcbae0a5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2bcbae0a5 | ||
|
|
1c21ad1ef7 |
@@ -41,5 +41,21 @@ services:
|
|||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 20
|
retries: 20
|
||||||
|
|
||||||
|
db-test:
|
||||||
|
image: mysql:5.7
|
||||||
|
profiles: [testing]
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: pollux_test
|
||||||
|
MYSQL_USER: pollux_test
|
||||||
|
MYSQL_PASSWORD: testing
|
||||||
|
MYSQL_ROOT_PASSWORD: testing-root
|
||||||
|
tmpfs:
|
||||||
|
- /var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -ptesting-root --silent"]
|
||||||
|
interval: 2s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 30
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ trait CreatesApplication
|
|||||||
|
|
||||||
$app->make(Kernel::class)->bootstrap();
|
$app->make(Kernel::class)->bootstrap();
|
||||||
|
|
||||||
|
// RefreshDatabase runs migrate:fresh. Refuse cached or overridden
|
||||||
|
// configuration that could point it at the application's database.
|
||||||
|
if (!$app->environment('testing')
|
||||||
|
|| config('database.default') !== 'mysql'
|
||||||
|
|| config('database.connections.mysql.host') !== 'db-test'
|
||||||
|
|| config('database.connections.mysql.database') !== 'pollux_test'
|
||||||
|
|| !empty(config('database.connections.mysql.unix_socket'))) {
|
||||||
|
throw new \RuntimeException('Tests require the isolated db-test / pollux_test database. Clear cached configuration before running tests.');
|
||||||
|
}
|
||||||
|
|
||||||
return $app;
|
return $app;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Tests\Unit;
|
|
||||||
|
|
||||||
use Tests\TestCase;
|
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
||||||
|
|
||||||
class ExampleTest extends TestCase
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* A basic test example.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function testBasicTest()
|
|
||||||
{
|
|
||||||
$this->assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user