Ilvsx's Blog

return practice() ? '1 week' : 'never';

Laracasts - PHPUnit Testing with Laravel

  • 01 Intro to Application Testing

  • 02 Beginning Unit Testing
    • use snake case
    • use comment: /** @test */
  • 03 More Unit Testing Review
    • test singel method : phpunit --filter method_name
  • 05 A Testing Database Connection
    • touch storage/testing.sqlite
    • database.php

      'sqllite_testing' => [
        'driver'  => 'sqlite',
        'database' => storage_path('testing.sqlite'),
        'prefix' => '',
      ]
      
    • php artisan migrate --database=sqlite_testing
    • phpunit.xml

      <env name="DB_CONNECTION" value="sqlite_testing"/>