Environment
phpunit.xml
APP_ENV="testing"
CACHE_DRIVER="array"
SESSION_DRIVER="array"
QUEUE_DRIVER="sync"
suffix="Test.php"
testsuite: Feature[./tests/Feature]
testsuite: Unit[./tests/Unit]
filter -> whitelist ->directory
.env.testing
Database_Connection
SMTP Mail
API Account
3 party API
Createing Tests
Artisan make:SampleTest
Artisan make:SampleTest --feature
Artisan make:SampleTest --unit
Manual Create file
Runing Tests
./vendor/bin/phpunit
./vendor/bin/phpunit --coverage-html
php artisan test
php artisan test --testsuite=Feature --stop-on-failure
php artisan test --testsuite=Unit --stop-on-failure
php artisan test --coverage-html
php artisan test --parallel
php artisan test --parallel --processes=4
php artisan test --parallel --recreate-databases
Database Tests
Resetting The Database After Each Test
Defining Model Factories
Generating Factories
Creating Models Using Factories
Factory Relationships
Has Many Relationships
Belongs To Relationships
Many To Many Relationships
Polymorphic Relationships
Defining Relationships Within Factories
Running Seeders
Available Assertions
assertDatabaseCount
assertDatabaseHas
assertDatabaseMissing
assertDeleted
assertModelExists
assertModelMissing
Browser Tests
Browser Basics
Creating Browsers
Navigation
Resizing Browser Windows
Browser Macros
Authentication
Cookies
Executing JavaScript
Taking A Screenshot
Storing Console Output To Disk
Storing Page Source To Disk
Interacting With Elements
Dusk Selectors
Text, Values, & Attributes
Interacting With Forms
Attaching Files
Pressing Buttons
Clicking Links
Using The Keyboard
Using The Mouse
JavaScript Dialogs
Scoping Selectors
Waiting For Elements
Scrolling An Element Into View
Available Assertions
Pages
Components
Continuous Integration
Mocking
Mocking Objects
Mocking Facades
Bus Fake
Event Fake
HTTP Fake
Mail Fake
Notification Fake
Queue Fake
Storage Fake
Interacting With Time