function DrupalComponentTest::testComponentLicense

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/DrupalComponentTest.php \Drupal\Tests\Component\DrupalComponentTest::testComponentLicense()
  2. 10 core/tests/Drupal/Tests/Component/DrupalComponentTest.php \Drupal\Tests\Component\DrupalComponentTest::testComponentLicense()

Tests LICENSE.txt is present and has the correct content.

@dataProvider getComponents

Parameters

string $component_path: The path to the component.

File

core/tests/Drupal/Tests/Component/DrupalComponentTest.php, line 46

Class

DrupalComponentTest
General tests for \Drupal\Component that can't go anywhere else.

Namespace

Drupal\Tests\Component

Code

public function testComponentLicense(string $component_path) : void {
    $this->assertFileExists($component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt');
    $this->assertSame('e84dac1d9fbb5a4a69e38654ce644cea769aa76b', hash_file('sha1', $component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt'));
}

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