public function SimplesitemapTest::testNewEntityWithIdSet in Simple XML sitemap 8.3
Same name and namespace in other branches
- 4.x tests/src/Functional/SimplesitemapTest.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTest::testNewEntityWithIdSet()
Tests that a page does not break if an entity has its id set.
File
- tests/
src/ Functional/ SimplesitemapTest.php, line 472
Class
- SimplesitemapTest
- Tests Simple XML Sitemap functional integration.
Namespace
Drupal\Tests\simple_sitemap\FunctionalCode
public function testNewEntityWithIdSet() {
$new_node = Node::create([
'nid' => mt_rand(5, 10),
'type' => 'page',
]);
// Assert that the form does not break if an entity has an id but is not
// saved.
// @see https://www.drupal.org/project/simple_sitemap/issues/3079897
\Drupal::service('entity.form_builder')
->getForm($new_node);
}