|
4 | 4 | */ |
5 | 5 | package com.magento.idea.magento2plugin.inspections.php; |
6 | 6 |
|
7 | | -import com.intellij.testFramework.fixtures.BasePlatformTestCase; |
8 | | -import java.io.File; |
9 | | - |
10 | | -public class GraphQlResolverInspectionTest extends BasePlatformTestCase { |
| 7 | +public class GraphQlResolverInspectionTest extends InspectionPhpFixtureTestCase { |
11 | 8 |
|
12 | 9 | @Override |
13 | 10 | public void setUp() throws Exception { |
14 | 11 | super.setUp(); |
15 | 12 | myFixture.enableInspections(GraphQlResolverInspection.class); |
16 | 13 | } |
17 | 14 |
|
18 | | - @Override |
19 | | - protected String getTestDataPath() { |
20 | | - return new File("testData/inspections/php/" |
21 | | - + getClass().getSimpleName().replace("Test", "")).getAbsolutePath(); |
22 | | - } |
23 | | - |
24 | 15 | @Override |
25 | 16 | protected boolean isWriteActionRequired() { |
26 | 17 | return false; |
27 | 18 | } |
28 | 19 |
|
29 | 20 | public void testWithInvalidResolverInterface() throws Exception { |
30 | | - myFixture.addFileToProject(getTestDataPath() + "/withInvalidResolverInterface/" + "schema.graphqls", "type Query {" + |
| 21 | + myFixture.addFileToProject("schema.graphqls", "type Query {" + |
31 | 22 | "InvalidResolverTest: InvalidResolver @resolver(class: \"\\\\Magento\\\\Test\\\\InvalidResolverTest\")" + |
32 | 23 | "}"); |
33 | | - myFixture.configureByFile(getTestName(true) + "/" + "InvalidResolverTest.php"); |
| 24 | + myFixture.configureByFile(getFixturePath("InvalidResolverTest.php")); |
34 | 25 | myFixture.checkHighlighting(); |
35 | 26 | } |
36 | 27 |
|
37 | 28 | public void testWithValidResolverInterface() throws Exception { |
38 | | - myFixture.addFileToProject(getTestDataPath() + "/withValidResolverInterface/" + "schema.graphqls", "type mutation {" + |
| 29 | + myFixture.addFileToProject("schema.graphqls", "type mutation {" + |
39 | 30 | " ValidResolverTest(): ValidResolver @resolver(class: \"\\\\Magento\\\\Test\\\\ValidResolverTest\")" + |
40 | 31 | "}"); |
41 | | - myFixture.configureByFile(getTestName(true) + "/" + "ValidResolverTest.php"); |
| 32 | + myFixture.configureByFile(getFixturePath("ValidResolverTest.php")); |
42 | 33 | myFixture.checkHighlighting(); |
43 | 34 | } |
44 | 35 | } |
0 commit comments