Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lightning_core
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
lightning_core
Merge requests
!19
Issue
#3223839
: PHP Warning and notices caused by contextual links on nodes
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Issue
#3223839
: PHP Warning and notices caused by contextual links on nodes
issue/lightning_core-3223839:3223839-php-warning-and
into
8.x-5.x
Overview
0
Commits
2
Pipelines
1
Changes
2
Merged
Issue #3223839: PHP Warning and notices caused by contextual links on nodes
Adam G-H
requested to merge
issue/lightning_core-3223839:3223839-php-warning-and
into
8.x-5.x
Nov 22, 2022
Overview
0
Commits
2
Pipelines
1
Changes
2
0
0
Merge request reports
Compare
8.x-5.x
version 2
e4329ff7
Nov 22, 2022
version 1
48a0f92c
Nov 22, 2022
8.x-5.x (base)
and
latest version
latest version
e4329ff7
2 commits,
Nov 22, 2022
version 2
e4329ff7
2 commits,
Nov 22, 2022
version 1
48a0f92c
1 commit,
Nov 22, 2022
2 files
+
52
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
tests/src/Kernel/ContextualLinksAlterTest.php
0 → 100644
+
47
−
0
View file @ e4329ff7
Edit in single-file editor
Open in Web IDE
<?php
namespace
Drupal\Tests\lightning_core\Kernel
;
use
Drupal\KernelTests\KernelTestBase
;
/**
* @covers lightning_core_contextual_links_plugins_alter
*
* @group lightning_core
*/
class
ContextualLinksAlterTest
extends
KernelTestBase
{
/**
* {@inheritdoc}
*/
protected
static
$modules
=
[
'block_content'
,
'contextual'
,
'lightning_core'
,
'node'
,
'taxonomy'
,
];
/**
* Tests that dynamic contextual links are defined correctly.
*/
public
function
testAlteredContextualLinks
():
void
{
$links
=
[
'block_content.block_edit_latest_version'
,
'entity.taxonomy_term.latest_version_edit_form'
,
'entity.node.latest_version_edit_form'
,
];
foreach
(
$links
as
$link_id
)
{
/** @var \Drupal\Core\Menu\ContextualLinkInterface $link */
$link
=
$this
->
container
->
get
(
'plugin.manager.menu.contextual_link'
)
->
createInstance
(
$link_id
);
$this
->
assertNotEmpty
(
$link
->
getTitle
());
$this
->
assertNotEmpty
(
$link
->
getRouteName
());
$this
->
assertNotEmpty
(
$link
->
getGroup
());
$this
->
assertIsArray
(
$link
->
getOptions
());
$this
->
assertIsInt
(
$link
->
getWeight
());
}
}
}
Loading