You are here

final class TestUpdateHandler in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Unit/UpdateManagerTest.php \Drupal\Tests\lightning_core\Unit\TestUpdateHandler
  2. 8 tests/src/Unit/UpdateManagerTest.php \Drupal\Tests\lightning_core\Unit\TestUpdateHandler
  3. 8.2 tests/src/Unit/UpdateManagerTest.php \Drupal\Tests\lightning_core\Unit\TestUpdateHandler
  4. 8.3 tests/src/Unit/UpdateManagerTest.php \Drupal\Tests\lightning_core\Unit\TestUpdateHandler

A test class containing discoverable updates.

Hierarchy

Expanded class hierarchy of TestUpdateHandler

File

tests/src/Unit/UpdateManagerTest.php, line 91

Namespace

Drupal\Tests\lightning_core\Unit
View source
final class TestUpdateHandler {

  /**
   * @update
   *
   * @ask Can you trip like I do?
   */
  public function foo(StyleInterface $io) {
    $io
      ->success('Dude, sweet!');
  }

  /**
   * @update
   *
   * @ask Why would you do this?
   */
  public function nope(StyleInterface $io) {
    $io
      ->error('Oh, the humanity!');
  }
  public function bar() {
  }

  /**
   * @update
   */
  protected function baz() {

    // Protected methods should not be discovered, even if they have the @update
    // annotation.
  }

  /**
   * @update
   */
  private function wambooli() {

    // As with protected methods, private methods should never be discovered
    // even if they have the @update annotation.
  }

}

Members

Namesort descending Modifiers Type Description Overrides
TestUpdateHandler::bar public function
TestUpdateHandler::baz protected function @update
TestUpdateHandler::foo public function @update
TestUpdateHandler::nope public function @update
TestUpdateHandler::wambooli private function @update