Creating Functional tests (simulated browser)
This tutorial explains how to test functionality by simulating a browser, foregoing actual Javascript/AJAX interactions.
Creating FunctionalJavascript tests (real browser)
This tutorial explains how to test functionality in a real browser, including Javascript/AJAX interactions.
PHPUnit file structure, namespace, and required metadata
File structure and namespace
Running PHPUnit tests
Execute PHPUnit tests from the command line.
Running PHPUnit JavaScript tests
Learn about how to run PHPUnit JavaScript tests Drupal 8.
Running PHPUnit tests within PhpStorm
Configure PhpStorm to run Drupal's PHPUnit tests.
Understanding PHPunit expectations
A mock object most of the time will contain an expectation like
Unit testing more complicated Drupal classes
Dealing with function calls
Using Prophecy
Mocking with Prophecy in PHPUnit
Comparison with PHPUnit mocks
Now that we saw how you can use prophecy as a start, let's compare it with the other frequently used PHPUnit mocking framework
Agile Unit Testing
What You Should Know
Mocking Entities and Services with PHPUnit and Mocks
Mocking complex entities and services in Unit Tests using PHPUnit mocking framework
Setup tasks in Kernel tests
Setup tasks in Kernel tests
Working with user sessions in tests
How to manipulate and examine user sessions in kernel and functional tests
Making HTTP requests programmatically in Kernel tests
How to use Kernel tests for tests that make simple HTTP requests