function DependencyTest::testCreateFromString

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Extension/DependencyTest.php \Drupal\Tests\Core\Extension\DependencyTest::testCreateFromString()
  2. 10 core/tests/Drupal/Tests/Core/Extension/DependencyTest.php \Drupal\Tests\Core\Extension\DependencyTest::testCreateFromString()
  3. 11.x core/tests/Drupal/Tests/Core/Extension/DependencyTest.php \Drupal\Tests\Core\Extension\DependencyTest::testCreateFromString()

@covers ::createFromString @dataProvider providerCreateFromString

File

core/tests/Drupal/Tests/Core/Extension/DependencyTest.php, line 19

Class

DependencyTest
@coversDefaultClass \Drupal\Core\Extension\Dependency @group Extension

Namespace

Drupal\Tests\Core\Extension

Code

public function testCreateFromString($string, $expected_name, $expected_project, $expected_constraint) {
    $dependency = Dependency::createFromString($string);
    $this->assertSame($expected_name, $dependency->getName());
    $this->assertSame($expected_project, $dependency->getProject());
    $this->assertSame($expected_constraint, $dependency->getConstraintString());
}

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