void (String text, String doc, List<String> url) { myFixture.configureByText("test.html", text); PsiElement originalElement = myFixture.getFile().findElementAt(myFixture.getEditor().getCaretModel().getOffset()); PsiElement element = DocumentationManager.getInstance(getProject()).findTargetElement(myFixture.getEditor(), myFixture.getFile()); DocumentationProvider documentationProvider = DocumentationManager.getProviderFromElement(originalElement); String generatedDoc = documentationProvider.generateDoc(element, originalElement); if (generatedDoc == null) { //noinspection ConstantConditions assertEquals(doc, generatedDoc); } else if (doc == null || !generatedDoc.startsWith(doc)) { throw new ComparisonFailure("Generated doc doesn't start with correct prefix", doc, generatedDoc); } assertEquals(url, documentationProvider.getUrlFor(element, originalElement)); }