class LegacyDrupal7Test in Service Container 7
Same name in this branch
- 7 tests/src/Legacy/LegacyDrupal7Test.php \Drupal\Tests\service_container\Legacy\LegacyDrupal7Test
- 7 lib/Drupal/service_container/Tests/LegacyDrupal7Test.php \Drupal\service_container\Tests\LegacyDrupal7Test
Same name and namespace in other branches
- 7.2 lib/Drupal/service_container/Tests/LegacyDrupal7Test.php \Drupal\service_container\Tests\LegacyDrupal7Test
Hierarchy
- class \Drupal\service_container\Tests\ServiceContainerIntegrationTestBase extends \Drupal\service_container\Tests\DrupalWebTestCase
- class \Drupal\service_container\Tests\LegacyDrupal7Test
Expanded class hierarchy of LegacyDrupal7Test
1 string reference to 'LegacyDrupal7Test'
- LegacyDrupal7Test::getInfo in lib/
Drupal/ service_container/ Tests/ LegacyDrupal7Test.php
File
- lib/
Drupal/ service_container/ Tests/ LegacyDrupal7Test.php, line 12 - Contains \Drupal\service_container\Tests\LegacyDrupal7Test.
Namespace
Drupal\service_container\TestsView source
class LegacyDrupal7Test extends ServiceContainerIntegrationTestBase {
/**
* {@inheritdoc}
*/
public static function getInfo() {
return array(
'name' => 'LegacyDrupal7Test',
'description' => 'Tests the legacy Drupal 7 integration service',
'group' => 'service_container',
);
}
public function testLegacyDrupal7() {
/** @var \Drupal\service_container\Legacy\Drupal7 $drupal7_service */
$drupal7_service = $this->container
->get('drupal7');
$this
->assertTrue($drupal7_service instanceof Drupal7);
$random_message = $this
->randomString();
$drupal7_service
->drupal_set_message($random_message, 'warning');
$messages = drupal_get_messages();
$this
->assertTrue(in_array($random_message, $messages['warning']));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LegacyDrupal7Test:: |
public static | function | ||
LegacyDrupal7Test:: |
public | function | ||
ServiceContainerIntegrationTestBase:: |
protected | property | The dependency injection container usable in the test. | |
ServiceContainerIntegrationTestBase:: |
protected | property | The profile to install as a basis for testing. | 1 |
ServiceContainerIntegrationTestBase:: |
protected | function | 5 |