You are here

public function UpdateManagerTest::testGetTasks in Lightning Core 8.5

Same name in this branch
  1. 8.5 tests/src/Unit/UpdateManagerTest.php \Drupal\Tests\lightning_core\Unit\UpdateManagerTest::testGetTasks()
  2. 8.5 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetTasks()
Same name and namespace in other branches
  1. 8.4 tests/src/Kernel/UpdateManagerTest.php \Drupal\Tests\lightning_core\Kernel\UpdateManagerTest::testGetTasks()

@covers ::getTasks

File

tests/src/Kernel/UpdateManagerTest.php, line 92

Class

UpdateManagerTest
@coversDefaultClass \Drupal\lightning_core\UpdateManager

Namespace

Drupal\Tests\lightning_core\Kernel

Code

public function testGetTasks() {
  $handler = new TestUpdate();
  $this
    ->assertFalse($handler->invoked);
  $tasks = $this->updateManager
    ->getTasks($handler);
  $this
    ->assertInstanceOf('Generator', $tasks);
  $this
    ->assertTrue($tasks
    ->valid());
  $this
    ->assertInstanceOf('\\Drupal\\lightning_core\\UpdateTask', $tasks
    ->current());
  $tasks
    ->current()
    ->execute($this
    ->prophesize('\\Symfony\\Component\\Console\\Style\\StyleInterface')
    ->reveal(), TRUE);
  $this
    ->assertTrue($handler->invoked);
}