public function ConfirmFormHelperTest::testCancelLinkTitle in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php \Drupal\Tests\Core\Form\ConfirmFormHelperTest::testCancelLinkTitle()
@covers ::buildCancelLink
Tests the cancel link title.
File
- core/
tests/ Drupal/ Tests/ Core/ Form/ ConfirmFormHelperTest.php, line 27 - Contains \Drupal\Tests\Core\Form\ConfirmFormHelperTest.
Class
- ConfirmFormHelperTest
- @coversDefaultClass \Drupal\Core\Form\ConfirmFormHelper @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testCancelLinkTitle() {
$cancel_text = 'Cancel text';
$form = $this
->getMock('Drupal\\Core\\Form\\ConfirmFormInterface');
$form
->expects($this
->any())
->method('getCancelText')
->will($this
->returnValue($cancel_text));
$link = ConfirmFormHelper::buildCancelLink($form, new Request());
$this
->assertSame($cancel_text, $link['#title']);
$this
->assertSame([
'contexts' => [
'url.query_args:destination',
],
], $link['#cache']);
}