function SkipOpTest::testProcess

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Integration\SkipOpTest::testProcess()
  2. 8.9.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Integration\SkipOpTest::testProcess()
  3. 11.x core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php \Drupal\Tests\Composer\Plugin\Scaffold\Integration\SkipOpTest::testProcess()

@covers ::process

File

core/tests/Drupal/Tests/Composer/Plugin/Scaffold/Integration/SkipOpTest.php, line 24

Class

SkipOpTest
@coversDefaultClass \Drupal\Composer\Plugin\Scaffold\Operations\SkipOp[[api-linebreak]]

Namespace

Drupal\Tests\Composer\Plugin\Scaffold\Integration

Code

public function testProcess() : void {
  $fixtures = new Fixtures();
  $destination = $fixtures->destinationPath('[web-root]/robots.txt');
  $options = ScaffoldOptions::create([]);
  $sut = new SkipOp();
  // Assert that there is no target file before we run our test.
  $this->assertFileDoesNotExist($destination->fullPath());
  // Test the system under test.
  $sut->process($destination, $fixtures->io(), $options);
  // Assert that the target file was not created.
  $this->assertFileDoesNotExist($destination->fullPath());
  // Confirm that expected output was written to our io fixture.
  $output = $fixtures->getOutput();
  $this->assertStringContainsString('Skip [web-root]/robots.txt: disabled', $output);
}

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