PsiFile (String name, String text) { myFile = createPsiFile(name, text); assertEquals("light virtual file text mismatch", text, ((LightVirtualFile)myFile.getVirtualFile()).getContent().toString()); assertEquals("virtual file text mismatch", text, LoadTextUtil.loadText(myFile.getVirtualFile())); assertEquals("doc text mismatch", text, Objects.requireNonNull(myFile.getViewProvider().getDocument()).getText()); if (checkAllPsiRoots()) { for (PsiFile root : myFile.getViewProvider().getAllFiles()) { doSanityChecks(root); } } else { doSanityChecks(myFile); } return myFile; }