Mercurial > hg > cmmr2012-drupal-site
comparison core/modules/link/tests/src/Functional/LinkFieldUITest.php @ 5:12f9dff5fda9 tip
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:34:47 +0100 |
parents | a9cd425dd02b |
children |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
1 <?php | 1 <?php |
2 | 2 |
3 namespace Drupal\Tests\link\Functional; | 3 namespace Drupal\Tests\link\Functional; |
4 | 4 |
5 use Drupal\Core\Url; | |
5 use Drupal\Component\Utility\Html; | 6 use Drupal\Component\Utility\Html; |
6 use Drupal\Core\Entity\Entity\EntityFormDisplay; | 7 use Drupal\Core\Entity\Entity\EntityFormDisplay; |
7 use Drupal\field\Entity\FieldConfig; | 8 use Drupal\field\Entity\FieldConfig; |
8 use Drupal\field\Entity\FieldStorageConfig; | 9 use Drupal\field\Entity\FieldStorageConfig; |
9 use Drupal\link\LinkItemInterface; | 10 use Drupal\link\LinkItemInterface; |
195 $this->drupalGet($add_path); | 196 $this->drupalGet($add_path); |
196 | 197 |
197 $expected_help_texts = [ | 198 $expected_help_texts = [ |
198 LinkItemInterface::LINK_EXTERNAL => 'This must be an external URL such as <em class="placeholder">http://example.com</em>.', | 199 LinkItemInterface::LINK_EXTERNAL => 'This must be an external URL such as <em class="placeholder">http://example.com</em>.', |
199 LinkItemInterface::LINK_GENERIC => 'You can also enter an internal path such as <em class="placeholder">/node/add</em> or an external URL such as <em class="placeholder">http://example.com</em>. Enter <em class="placeholder"><front></em> to link to the front page.', | 200 LinkItemInterface::LINK_GENERIC => 'You can also enter an internal path such as <em class="placeholder">/node/add</em> or an external URL such as <em class="placeholder">http://example.com</em>. Enter <em class="placeholder"><front></em> to link to the front page.', |
200 LinkItemInterface::LINK_INTERNAL => rtrim(\Drupal::url('<front>', [], ['absolute' => TRUE]), '/'), | 201 LinkItemInterface::LINK_INTERNAL => rtrim(Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString(), '/'), |
201 ]; | 202 ]; |
202 | 203 |
203 // Check that the help texts we assume should be there, is there. | 204 // Check that the help texts we assume should be there, is there. |
204 $this->assertFieldContainsRawText($field_name, $expected_help_texts[$link_type]); | 205 $this->assertFieldContainsRawText($field_name, $expected_help_texts[$link_type]); |
205 if ($link_type === LinkItemInterface::LINK_INTERNAL) { | 206 if ($link_type === LinkItemInterface::LINK_INTERNAL) { |