class DbToolsApplicationTest
Same name and namespace in other branches
- 11.x core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php \Drupal\Tests\system\Kernel\Scripts\DbToolsApplicationTest
- 10 core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php \Drupal\Tests\system\Kernel\Scripts\DbToolsApplicationTest
- 8.9.x core/modules/system/tests/src/Kernel/Scripts/DbToolsApplicationTest.php \Drupal\Tests\system\Kernel\Scripts\DbToolsApplicationTest
Test that the DbToolsApplication works correctly.
The way console application's run it is impossible to test. For now we only test that we are registering the correct commands.
@group console
Hierarchy
- class \Drupal\KernelTests\KernelTestBase implements \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait extends \PHPUnit\Framework\TestCase
- class \Drupal\Tests\system\Kernel\Scripts\DbToolsApplicationTest extends \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of DbToolsApplicationTest
File
-
core/
modules/ system/ tests/ src/ Kernel/ Scripts/ DbToolsApplicationTest.php, line 16
Namespace
Drupal\Tests\system\Kernel\ScriptsView source
class DbToolsApplicationTest extends KernelTestBase {
/**
* Tests that the dump command is correctly registered.
*/
public function testDumpCommandRegistration() {
$application = new DbToolsApplication();
$command = $application->find('dump');
$this->assertInstanceOf('\\Drupal\\Core\\Command\\DbDumpCommand', $command);
$this->assertSame(\Drupal::VERSION, $application->getVersion());
}
/**
* Tests that the dump command is correctly registered.
*/
public function testImportCommandRegistration() {
$application = new DbToolsApplication();
$command = $application->find('import');
$this->assertInstanceOf('\\Drupal\\Core\\Command\\DbImportCommand', $command);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.