HelpMessageHelperTest.php in Acquia Lift Connector 8.4
File
tests/src/Unit/Service/Helper/HelpMessageHelperTest.php
View source
<?php
namespace Drupal\Tests\acquia_lift\Unit\Service\Helper;
use Drupal\Tests\UnitTestCase;
use Drupal\acquia_lift\Service\Helper\HelpMessageHelper;
class HelpMessageHelperTest extends UnitTestCase {
public function testGetMessageAdminSettingsFormNoApiUrl($route_name, $has_message) {
$help_message_helper = new HelpMessageHelper();
$help_message_helper
->setStringTranslation($this
->getStringTranslationStub());
$message = $help_message_helper
->getMessage($route_name);
if ($has_message) {
$this
->assertEquals('You can find more info in <a href="https://docs.acquia.com/lift" target="_blank">Documentation</a>.', $message
->render());
}
else {
$this
->assertNull($message);
}
}
public function providerRouteNames() {
$data = [];
$data['help page, has message'] = [
'help.page.acquia_lift',
TRUE,
];
$data['admin settings form, has message'] = [
'acquia_lift.admin_settings_form',
TRUE,
];
$data['admin settings form, has no message'] = [
'acquia_contenthub.admin_settings_form',
FALSE,
];
return $data;
}
}