You are here

public function ViewUnpublishedDependencyTest::testDependencyRemoved in view_unpublished 8

Tests the remove dependency install helper.

File

tests/src/Kernel/ViewUnpublishedDependencyTest.php, line 59

Class

ViewUnpublishedDependencyTest
Tests the View Unpublished dependency issue.

Namespace

Drupal\Tests\view_unpublished\Kernel

Code

public function testDependencyRemoved() {
  $module_deps = $this
    ->config('views.view.content')
    ->get('dependencies.module');
  $module_deps[] = 'view_unpublished';
  $this
    ->config('views.view.content')
    ->set('dependencies.module', $module_deps)
    ->save(TRUE);
  $this->container
    ->get('view_unpublished.install_helper')
    ->removeDependency();
  $module_deps = $this
    ->config('views.view.content')
    ->get('dependencies.module');
  $this
    ->assertNotEmpty($module_deps);
  $this
    ->assertArrayNotHasKey('view_unpublished', array_flip($module_deps));
}