assertNoCoreUsage example


class DrupalComponentTest extends TestCase {

  /** * Tests that classes in Component do not use any Core class. */
  public function testNoCoreInComponent() {
    $component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/lib/Drupal/Component';
    foreach ($this->findPhpClasses($component_path) as $class) {
      $this->assertNoCoreUsage($class);
    }
  }

  /** * Tests that classes in Component Tests do not use any Core class. */
  public function testNoCoreInComponentTests() {
    $component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/tests/Drupal/Tests/Component';
    foreach ($this->findPhpClasses($component_path) as $class) {
      $this->assertNoCoreUsage($class);
    }
  }
Home | Imprint | This part of the site doesn't use cookies.