function ConfirmFormHelperTest::testCancelLinkTitle
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php \Drupal\Tests\Core\Form\ConfirmFormHelperTest::testCancelLinkTitle()
- 8.9.x core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php \Drupal\Tests\Core\Form\ConfirmFormHelperTest::testCancelLinkTitle()
- 10 core/tests/Drupal/Tests/Core/Form/ConfirmFormHelperTest.php \Drupal\Tests\Core\Form\ConfirmFormHelperTest::testCancelLinkTitle()
Tests the cancel link title.
@covers ::buildCancelLink
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ ConfirmFormHelperTest.php, line 24
Class
- ConfirmFormHelperTest
- @coversDefaultClass \Drupal\Core\Form\ConfirmFormHelper @group Form
Namespace
Drupal\Tests\Core\FormCode
public function testCancelLinkTitle() : void {
$cancel_text = 'Cancel text';
$form = $this->createMock('Drupal\\Core\\Form\\ConfirmFormInterface');
$form->expects($this->any())
->method('getCancelText')
->willReturn($cancel_text);
$link = ConfirmFormHelper::buildCancelLink($form, new Request());
$this->assertSame($cancel_text, $link['#title']);
$this->assertSame([
'contexts' => [
'url.query_args:destination',
],
], $link['#cache']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.