Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal_cms
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal_cms
Merge requests
!505
Issue
#3498036
: Add test for Sitemap module enabled plugins
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Issue
#3498036
: Add test for Sitemap module enabled plugins
issue/drupal_cms-3498036:3498036-sitemap-default-plugins
into
1.x
Overview
0
Commits
2
Pipelines
5
Changes
1
Merged
Riyas N R
requested to merge
issue/drupal_cms-3498036:3498036-sitemap-default-plugins
into
1.x
2 months ago
Overview
0
Commits
2
Pipelines
5
Changes
1
Expand
Closes
#3498036
0
0
Merge request reports
Compare
1.x
version 3
82bec0de
2 months ago
version 2
e2a6e4af
2 months ago
version 1
375c3dec
2 months ago
1.x (base)
and
latest version
latest version
82bec0de
2 commits,
2 months ago
version 3
82bec0de
2 commits,
2 months ago
version 2
e2a6e4af
2 commits,
2 months ago
version 1
375c3dec
1 commit,
2 months ago
1 file
+
20
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
recipes/drupal_cms_seo_tools/tests/src/Functional/ComponentValidationTest.php
+
20
−
3
Options
@@ -6,6 +6,7 @@ namespace Drupal\Tests\drupal_cms_seo_tools\Functional;
use
Drupal\field\Entity\FieldConfig
;
use
Drupal\FunctionalTests\Core\Recipe\RecipeTestTrait
;
use
Drupal\menu_link_content
\Entity\MenuLinkContent
;
use
Drupal\Tests\BrowserTestBase
;
/**
@@ -53,12 +54,28 @@ class ComponentValidationTest extends BrowserTestBase {
}
/**
* Checks the sitemap is accessible.
* Checks
that
the sitemap is accessible
and contains the expected links
.
*/
private
function
checkSitemap
():
void
{
// Create a main menu link to ensure it shows up in the site map.
$node
=
$this
->
drupalCreateNode
([
'type'
=>
'test'
]);
$menu_link
=
MenuLinkContent
::
create
([
'title'
=>
$node
->
getTitle
(),
'link'
=>
'internal:'
.
$node
->
toUrl
()
->
toString
(),
'menu_name'
=>
'main'
,
]);
$menu_link
->
save
();
$this
->
drupalGet
(
'/sitemap'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
assertSession
()
->
linkByHrefNotExists
(
'/rss.xml'
);
$assert_session
=
$this
->
assertSession
();
$assert_session
->
statusCodeEquals
(
200
);
$assert_session
->
linkByHrefNotExists
(
'/rss.xml'
);
$site_map
=
$assert_session
->
elementExists
(
'css'
,
'.sitemap'
);
$site_name
=
$this
->
config
(
'system.site'
)
->
get
(
'name'
);
$this
->
assertTrue
(
$site_map
->
hasLink
(
"Front page of
$site_name
"
),
'Front page link does not appear in the site map.'
);
$this
->
assertTrue
(
$site_map
->
hasLink
(
$menu_link
->
label
()),
'Main menu links do not appear in the site map.'
);
}
}
Loading