You are here

public function ScaffoldTest::testScaffoldWithExpectedException in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Functional\ScaffoldTest::testScaffoldWithExpectedException()

Tests that scaffold files throw when they have bad values.

@dataProvider scaffoldExpectedExceptionTestValues

Parameters

string $fixture_name: The name of the fixture to use from core/tests/Drupal/Tests/Component/Scaffold/fixtures.

string $expected_exception_message: The expected exception message.

bool $is_link: Whether or not symlinking should be used.

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Functional/ScaffoldTest.php, line 171

Class

ScaffoldTest
Tests Composer Scaffold.

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Functional

Code

public function testScaffoldWithExpectedException($fixture_name, $expected_exception_message, $is_link) {

  // Test scaffold. Expect an error.
  $this
    ->expectException(\Exception::class);
  $this
    ->expectExceptionMessage($expected_exception_message);
  $this
    ->scaffoldSut($fixture_name, $is_link);
}