File tree Expand file tree Collapse file tree
tests/src/Kernel/DataProducer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121 <rule ref =" DrupalPractice.CodeAnalysis.VariableAnalysis.UndefinedVariable" >
2222 <exclude-pattern >src/Plugin/GraphQL/DataProducer/Field/EntityReference.php</exclude-pattern >
23- <exclude-pattern >tests/src/Kernel/DataProducer/MenuTest.php</exclude-pattern >
2423 </rule >
2524
2625 <!-- TODO: those rules are disabled for now until we fix the coding standards for them. -->
Original file line number Diff line number Diff line change @@ -143,16 +143,20 @@ public function testMenuTreeSubtree() {
143143 */
144144 public function testMenuLinkAttribute () {
145145 $ attribute = 'target ' ;
146+ $ assert_happened = FALSE ;
146147 foreach ($ this ->linkTree as $ link_tree ) {
148+ $ options = $ link_tree ->link ->getOptions ();
147149 if (!empty ($ options ['attributes ' ][$ attribute ])) {
148150 $ result = $ this ->executeDataProducer ('menu_link_attribute ' , [
149151 'link ' => $ link_tree ->link ,
150152 'attribute ' => 'target ' ,
151153 ]);
152154
153155 $ this ->assertEquals ($ options ['attributes ' ][$ attribute ], $ result );
156+ $ assert_happened = TRUE ;
154157 }
155158 }
159+ $ this ->assertTrue ($ assert_happened , 'At least one menu attribute was tested ' );
156160 }
157161
158162 /**
You can’t perform that action at this time.
0 commit comments