You are here

class LegacyDrupal7Test in Service Container 8

Same name and namespace in other branches
  1. 7.2 tests/src/Legacy/LegacyDrupal7Test.php \Drupal\Tests\service_container\Legacy\LegacyDrupal7Test
  2. 7 tests/src/Legacy/LegacyDrupal7Test.php \Drupal\Tests\service_container\Legacy\LegacyDrupal7Test

@coversDefaultClass \Drupal\service_container\Legacy\Drupal7

Hierarchy

  • class \Drupal\Tests\service_container\Legacy\LegacyDrupal7Test extends \Drupal\Tests\service_container\Legacy\PHPUnit_Framework_TestCase

Expanded class hierarchy of LegacyDrupal7Test

File

tests/src/Legacy/LegacyDrupal7Test.php, line 14
Contains \Drupal\Tests\service_container\Legacy\LegacyDrupal7Test.

Namespace

Drupal\Tests\service_container\Legacy
View source
class LegacyDrupal7Test extends \PHPUnit_Framework_TestCase {

  /**
   * The tested Drupal7 service.
   *
   * @var \Drupal\service_container\Legacy\Drupal7
   */
  protected $drupal7_service;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();
    $this->drupal7_service = new Drupal7();
  }

  /**
   * @covers ::__call()
   */
  public function test_call() {
    $random_string = 'is_a_lovely_cat!';
    $this
      ->assertEquals('izumi_is_a_lovely_cat!', $this->drupal7_service
      ->drupal7_legacy_test_function($random_string), 'Calling function via legacy service works.');
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LegacyDrupal7Test::$drupal7_service protected property The tested Drupal7 service.
LegacyDrupal7Test::setUp protected function
LegacyDrupal7Test::test_call public function @covers ::__call()