void () { Module m = createModule("m.iml", StdModuleTypes.JAVA); Module a = createModule("a.iml", StdModuleTypes.JAVA); Module b = createModule("b.iml", StdModuleTypes.JAVA); Module c = createModule("c.iml", StdModuleTypes.JAVA); ModuleRootModificationUtil.addDependency(a, m, DependencyScope.COMPILE, false); ModuleRootModificationUtil.addDependency(b, m, DependencyScope.COMPILE, true); ModuleRootModificationUtil.addDependency(a, b, DependencyScope.COMPILE, true); ModuleRootModificationUtil.addDependency(c, a, DependencyScope.COMPILE, true); VirtualFile root = myFixture.findOrCreateDir("c"); PsiTestUtil.addSourceContentToRoots(c, root); VirtualFile file = createChildData(root, "x.txt"); GlobalSearchScope deps = m.getModuleWithDependentsScope(); assertTrue(deps.contains(file)); }