You are here

public function PackageTest::testSetDependencies in Features 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Unit/PackageTest.php \Drupal\Tests\features\Unit\PackageTest::testSetDependencies()

@covers ::setDependencies

File

tests/src/Unit/PackageTest.php, line 17

Class

PackageTest
@coversDefaultClass \Drupal\features\Package @group features

Namespace

Drupal\Tests\features\Unit

Code

public function testSetDependencies() {
  $package = new Package('test_feature', []);
  $this
    ->assertEquals([], $package
    ->getDependencies());
  $package
    ->setDependencies([
    'some_module',
    'my_module',
    'my_module',
    'test_feature',
  ]);

  // Test that duplicates are removed, results sorted, and the package cannot

  /// require itself.
  $expected = [
    'my_module',
    'some_module',
  ];
  $this
    ->assertEquals($expected, $package
    ->getDependencies());
}