Skip to content

Commit 6a7233d

Browse files
committed
Merge pull request #60 from agallou/fix_no_namespace
fix navigation to test class when the tested class is in the global namespace
2 parents 84c0141 + b08e2c6 commit 6a7233d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# `dev-master`
22

3+
## Bugfix
4+
5+
* [#60](https://github.com/atoum/phpstorm-plugin/pull/60) Fix navigation to test class when the tested class is in the global namespace ([@agallou])
36

47

58
# 0.6.0 - 2016-02-07

src/org/atoum/intellij/plugin/atoum/Utils.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public static PhpClass locateTestClass(Project project, PhpClass testedClass) {
3232

3333
@Nullable
3434
public static Collection<PhpClass> locateTestClasses(Project project, PhpClass testedClass) {
35+
if (testedClass.getNamespaceName().length() == 1) {
36+
Collection<PhpClass> foundClasses = locatePhpClasses(project, getTestsNamespaceSuffix() + testedClass.getName());
37+
if (foundClasses.size() > 0) {
38+
return foundClasses;
39+
}
40+
}
41+
3542
String[] namespaceParts = testedClass.getNamespaceName().split("\\\\");
3643

3744
for(int i=namespaceParts.length; i>=1; i--){

0 commit comments

Comments
 (0)