function DrupalApplicationTesterTrait::applicationTester
Same name and namespace in other branches
- main core/tests/Drupal/KernelTests/DrupalApplicationTesterTrait.php \Drupal\KernelTests\DrupalApplicationTesterTrait::applicationTester()
Build our ApplicationTester.
5 calls to DrupalApplicationTesterTrait::applicationTester()
- ConsoleTest::testApplication in core/
tests/ Drupal/ KernelTests/ Core/ Console/ ConsoleTest.php - Tests the application wrapped by symfony/runtime.
- ConsoleTest::testConsoleCommand in core/
tests/ Drupal/ KernelTests/ Core/ Console/ ConsoleTest.php - Tests running a console command.
- ConsoleTest::testSubdirectoryCommand in core/
tests/ Drupal/ KernelTests/ Core/ Console/ ConsoleTest.php - Tests running a console command defined in a subdirectory.
- StatusCommandTest::testDrupalUriContext in core/
modules/ system/ tests/ src/ Kernel/ Command/ StatusCommandTest.php - Tests variations of the 'DRUPAL_URI' context.
- StatusCommandTest::testWithUrl in core/
modules/ system/ tests/ src/ Kernel/ Command/ StatusCommandTest.php - Tests the example:command with the --url option forced into argv.
File
-
core/
tests/ Drupal/ KernelTests/ DrupalApplicationTesterTrait.php, line 20
Class
- DrupalApplicationTesterTrait
- Trait to help with testing the drupal console.
Namespace
Drupal\KernelTestsCode
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.