You are here

class LinkGeneratorTest in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/service_container/Tests/LinkGeneratorTest.php \Drupal\service_container\Tests\LinkGeneratorTest

Hierarchy

Expanded class hierarchy of LinkGeneratorTest

File

lib/Drupal/service_container/Tests/LinkGeneratorTest.php, line 10
Contains \Drupal\service_container\Tests\LinkGeneratorTest.

Namespace

Drupal\service_container\Tests
View source
class LinkGeneratorTest extends ServiceContainerIntegrationTestBase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'LinkGenerator',
      'description' => '',
      'group' => 'service_container',
    );
  }

  /**
   * Adds some really basic integration test.
   */
  public function testL() {
    $result = \Drupal::service('link_generator')
      ->l('Title', 'test-path');
    $url = url('test-path');
    $this
      ->assertEqual("<a href=\"{$url}\">Title</a>", $result);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LinkGeneratorTest::getInfo public static function
LinkGeneratorTest::testL public function Adds some really basic integration test.
ServiceContainerIntegrationTestBase::$container protected property The dependency injection container usable in the test.
ServiceContainerIntegrationTestBase::$profile protected property The profile to install as a basis for testing. 1
ServiceContainerIntegrationTestBase::setUp protected function 5