2. • Automated testing is a process by which we rely on special software to
continuously run pre-defined tests that verify the integrity of our application. To
this end, automated tests are a collection of steps that cover the functionality of
an application and compare triggered outcomes to expected ones.
• Regression in manual testing
• special software that has an API that allows us to automate the steps involved in
testing the functionality
3. TESTING METHODOLOGIES IN DRUPAL 8
• Simpletest: exists for legacy reasons but no longer used to create new tests. This will
be removed in Drupal 9.
• Unit: low-level class testing with minimal dependencies (usually mocked).
• Kernel: functional testing with the kernel bootstrapped, access to the database and
only a few loaded modules.
• Functional: functional testing with a bootstrapped Drupal instance, a few installed
modules and using a Mink-based browser emulator (Goutte driver).
• Functional JavaScript: functional testing like the previous, using the Selenium driver
for Mink that allows for testing JavaScript powered functionality.
5. REGISTERING TESTS
1.tests/src/[suite_type], where [suite_type] is a name of the test suite type this test
should be. And it can be one of the following:
• Unit
• Kernel
• Functional
• FunctionalJavascript
2. namespace DrupalTests[module_name][suite_type]
6. • the setUp() method which is called by PHPUnit before each test method runs. Its
purpose is to perform various preparation tasks that are common for all the tests
in the class. In fact, it runs before each individual test method
8. KERNEL TESTS
• Immediate higher-level testing methodology
• integration tests that focus on testing various components
• Don't handle any browser interactions
• mysql://username:password@localhost/databasename#table_prefix
• KernelTestBase
• tests/src/Kernel folder of our module
9. • specify which modules we want loaded when running this test
10.
11. FUNCTIONAL TESTS
• Functional tests in Drupal 8 use a simulated browser (using the popular Mink
emulator) that allows users to click links, navigate to pages, work with forms and
make assertions regarding HTML elements on the page
• Don't allow us is to test JavaScript-based interactions.
• Browser tests perform a full Drupal installation with a minimal number of modules
• DrupalTestsBrowserTestBase