You are here

public function FeaturesManagerTest::testDetectNewWithNewConfig in Features 8.3

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

File

tests/src/Unit/FeaturesManagerTest.php, line 782

Class

FeaturesManagerTest
@coversDefaultClass Drupal\features\FeaturesManager @group features

Namespace

Drupal\Tests\features\Unit

Code

public function testDetectNewWithNewConfig() {
  $package = new Package('test_feature', [
    'config' => [
      'test_config',
    ],
  ]);
  $extension_storage = $this
    ->prophesize(FeaturesExtensionStoragesInterface::class);
  $extension_storage
    ->read('test_config')
    ->willReturn(FALSE);
  $features_manager = new TestFeaturesManager($this->root, $this->entityTypeManager, $this->configFactory, $this->configStorage, $this->configManager, $this->moduleHandler, $this->configReverter, $this->moduleExtensionList);
  $features_manager
    ->setExtensionStorages($extension_storage
    ->reveal());
  $this
    ->assertEquals([
    'test_config',
  ], $features_manager
    ->detectNew($package));
}