Browse Source

[6.x] Implement integration test and in-memory DB (#5169)

* Use in-memory DB for testing

* Extend from PHPUnit test case for unit tests
Dries Vints 4 years ago
parent
commit
f4b1dc6df0
2 changed files with 3 additions and 2 deletions
  1. 2 0
      phpunit.xml
  2. 1 2
      tests/Unit/ExampleTest.php

+ 2 - 0
phpunit.xml

@@ -28,6 +28,8 @@
         <server name="APP_ENV" value="testing"/>
         <server name="BCRYPT_ROUNDS" value="4"/>
         <server name="CACHE_DRIVER" value="array"/>
+        <server name="DB_CONNECTION" value="sqlite"/>
+        <server name="DB_DATABASE" value=":memory:"/>
         <server name="MAIL_DRIVER" value="array"/>
         <server name="QUEUE_CONNECTION" value="sync"/>
         <server name="SESSION_DRIVER" value="array"/>

+ 1 - 2
tests/Unit/ExampleTest.php

@@ -2,8 +2,7 @@
 
 namespace Tests\Unit;
 
-use Illuminate\Foundation\Testing\RefreshDatabase;
-use Tests\TestCase;
+use PHPUnit\Framework\TestCase;
 
 class ExampleTest extends TestCase
 {