You are here

public function DrupalComponentTest::testNoCoreInComponent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Component/DrupalComponentTest.php \Drupal\Tests\Component\DrupalComponentTest::testNoCoreInComponent()

Tests that classes in Component do not use any Core class.

File

core/tests/Drupal/Tests/Component/DrupalComponentTest.php, line 23
Contains \Drupal\Tests\Component\DrupalComponentTest.

Class

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

Namespace

Drupal\Tests\Component

Code

public function testNoCoreInComponent() {
  $component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/lib/Drupal/Component';
  foreach ($this
    ->findPhpClasses($component_path) as $class) {
    $this
      ->assertNoCoreUsage($class);
  }
}