trait DrupalApplicationTesterTrait
Same name and namespace in other branches
- 11.x 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);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.