function GenerateThemeTest::testThemeDoesNotExist

Same name in this branch
  1. 11.x core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php \Drupal\BuildTests\Command\GenerateThemeTest::testThemeDoesNotExist()
Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php \Drupal\Tests\Core\Command\GenerateThemeTest::testThemeDoesNotExist()
  2. 10 core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php \Drupal\Tests\Core\Command\GenerateThemeTest::testThemeDoesNotExist()
  3. 10 core/tests/Drupal/BuildTests/Command/GenerateThemeTest.php \Drupal\BuildTests\Command\GenerateThemeTest::testThemeDoesNotExist()

Tests themes that do not exist return an error.

File

core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php, line 310

Class

GenerateThemeTest
Tests the generate-theme commands.

Namespace

Drupal\Tests\Core\Command

Code

public function testThemeDoesNotExist() : void {
    $install_command = [
        $this->php,
        'core/scripts/drupal',
        'generate-theme',
        'test_custom_theme',
        '--name="Test custom starterkit theme"',
        '--description="Custom theme generated from a starterkit theme"',
        '--starterkit',
        'foobarbaz',
    ];
    $process = new Process($install_command, NULL);
    $process->setTimeout(60);
    $result = $process->run();
    $this->assertStringContainsString('Theme source theme foobarbaz cannot be found.', trim($process->getErrorOutput()));
    $this->assertSame(1, $result);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.