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 {
2323 }
2424
2525 protected void assertHasReferenceToXmlAttributeValue (String reference ) {
26+ String referenceNotFound = "Failed that element contains reference to the attribute value `%s`" ;
27+
2628 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 ));
2841 }
2942
3043 protected void assertHasReferenceToFile (String reference ) {
You can’t perform that action at this time.
0 commit comments