PHP code example of michaeljennings / refresh-database

1. Go to this page and download the library: Download michaeljennings/refresh-database library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

michaeljennings / refresh-database example snippets


use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use MichaelJennings\RefreshDatabase\RefreshDatabase;

class TestCase extends BaseTestCase
{
    use RefreshDatabase;
}

return [
  ...
  'connections' => [
    'shared' => [
      'driver' => 'sqlite',
        'database' => ':memory:',
        'prefix' => '',
      ],
      'tenant' => [
        'driver' => 'sqlite',
        'database' => ':memory:',
        'prefix' => '',
      ],
  ]
  ...
]
xml
<phpunit bootstrap="./vendor/michaeljennings/refresh-database/src/bootstrap.php">
  <testsuites>
    <testsuite name="Standard Test Suite">
      <directory>tests</directory>
    </testsuite>
  </testsuites>
</phpunit>
xml
<phpunit bootstrap="./vendor/michaeljennings/refresh-database/src/bootstrap.php">
  <testsuites>
    <testsuite name="Standard Test Suite">
      <directory>tests</directory>
    </testsuite>
  </testsuites>
  <php>
    <env name="DUMP_DATABASE" value="false"></env>
  </php>
</phpunit>