File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
tests/com/magento/idea/magento2plugin/reference Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,21 @@ protected void setUp() throws Exception {
23
23
}
24
24
25
25
protected void assertHasReferenceToXmlAttributeValue (String reference ) {
26
+ String referenceNotFound = "Failed that element contains reference to the attribute value `%s`" ;
27
+
26
28
PsiElement element = getElementFromCaret ();
27
- assertEquals (reference , ((XmlAttributeValue ) element .getReferences ()[0 ].resolve ()).getValue ());
29
+ for (PsiReference psiReference : element .getReferences ()) {
30
+ PsiElement resolved = psiReference .resolve ();
31
+ if (!(resolved instanceof XmlAttributeValue )) {
32
+ continue ;
33
+ }
34
+
35
+ if (((XmlAttributeValue ) resolved ).getValue ().equals (reference )) {
36
+ return ;
37
+ }
38
+ }
39
+
40
+ fail (String .format (referenceNotFound , reference ));
28
41
}
29
42
30
43
protected void assertHasReferenceToFile (String reference ) {
You can’t perform that action at this time.
0 commit comments