Skip to content

Commit

Permalink
Add memory based testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Villavicencio committed Jun 16, 2020
1 parent 6cdbdb2 commit 592fa32
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate --force
- name: Directory Permissions
Expand Down
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

'testing' => [
'driver' => 'sqlite',
'database' => database_path('database-test.sqlite'),
'database' => ':memory:',
'prefix' => '',
],

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</whitelist>
</filter>
<php>
<server name="APP_server" value="testing"/>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,16 @@ public function createApplication()

return $app;
}

protected function setUp(): void
{
parent::setUp();
Artisan::call('migrate');
}

protected function tearDown(): void
{
Artisan::call('migrate:reset');
parent::tearDown();
}
}

0 comments on commit 592fa32

Please sign in to comment.