function BasicTest::testDisplayName in Plug 7
Test if displayName() handles the names right.
File
- modules/
plug_example/ lib/ Drupal/ plug_example/ Tests/ BasicTest.php, line 114 - Basic tests cases for plug_example module.
Class
Namespace
Drupal\plug_example\TestsCode
function testDisplayName() {
/** @var \Drupal\plug_example\Plugin\name\JohnTest $plugin */
$plugin = $this->manager
->createInstance('john_test', array(
'em' => TRUE,
));
$this
->assertEqual($plugin
->displayName(), 'My name is: %name');
$plugin = $this->manager
->createInstance('john_test', array(
'em' => FALSE,
));
$this
->assertEqual($plugin
->displayName(), 'My name is: @name');
/** @var \Drupal\plug_example\Plugin\name\AcmeTest $plugin */
$plugin = $this->manager
->createInstance('acme_test', array(
'em' => TRUE,
));
$this
->assertEqual($plugin
->displayName(), 'Company name: %name Inc.');
$plugin = $this->manager
->createInstance('acme_test', array(
'em' => FALSE,
));
$this
->assertEqual($plugin
->displayName(), 'Company name: @name Inc.');
}