trait DrupalApplicationTesterTrait
Same name and namespace in other branches
- main core/tests/Drupal/KernelTests/DrupalApplicationTesterTrait.php \Drupal\KernelTests\DrupalApplicationTesterTrait
Trait to help with testing the drupal console.
Hierarchy
- trait \Drupal\KernelTests\DrupalApplicationTesterTrait uses \Drupal\Tests\Composer\ComposerIntegrationTrait
2 files declare their use of DrupalApplicationTesterTrait
- ConsoleTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Console/ ConsoleTest.php - StatusCommandTest.php in core/
modules/ system/ tests/ src/ Kernel/ Command/ StatusCommandTest.php
File
-
core/
tests/ Drupal/ KernelTests/ DrupalApplicationTesterTrait.php, line 13
Namespace
Drupal\KernelTestsView source
trait DrupalApplicationTesterTrait {
use ComposerIntegrationTrait;
/**
* Build our ApplicationTester.
*/
private function applicationTester(array $context = []) : ApplicationTester {
$application = include static::binDir() . '/dr';
$context['kernel.environment'] = 'testing';
$context['kernel.allow_dumping'] = FALSE;
$application = $application($context);
$application->setAutoExit(FALSE);
return new ApplicationTester($application);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| ComposerIntegrationTrait::binDir | public static | function | Gets the absolute path to the Composer bin directory. |
| ComposerIntegrationTrait::getComposerJsonFinder | public static | function | Get a Finder object to traverse all of the composer.json files in core. |
| DrupalApplicationTesterTrait::applicationTester | private | function | Build our ApplicationTester. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.