Skip to content

Commit a17714c

Browse files
authored
Merge pull request Haehnchen#1208 from cedricziel/2018-2-stable
Update build environment to 2018.2 stable
2 parents c838cdc + 26e9e8b commit a17714c

File tree

6 files changed

+76
-37
lines changed

6 files changed

+76
-37
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before_install:
2222
- "export ORG_GRADLE_PROJECT_annotationPluginVersion=${ANNOTATION_PLUGIN_VERSION}"
2323

2424
env:
25-
- PHPSTORM_ENV="skip incomplete" IDEA_VERSION="IU-182.2949.4" PHP_PLUGIN_VERSION="182.2949.27" TWIG_PLUGIN_VERSION="182.2757.22" TOOLBOX_PLUGIN_VERSION="0.4.6" ANNOTATION_PLUGIN_VERSION="5.3"
25+
- PHPSTORM_ENV="skip incomplete" IDEA_VERSION="IU-2018.2" PHP_PLUGIN_VERSION="182.3684.42" TWIG_PLUGIN_VERSION="182.3458.35" TOOLBOX_PLUGIN_VERSION="0.4.6" ANNOTATION_PLUGIN_VERSION="5.3"
2626
- PHPSTORM_ENV="skip incomplete" IDEA_VERSION="IU-2018.1" PHP_PLUGIN_VERSION="181.4203.565" TWIG_PLUGIN_VERSION="181.3741.23" TOOLBOX_PLUGIN_VERSION="0.4.6" ANNOTATION_PLUGIN_VERSION="5.3"
2727
- PHPSTORM_ENV="skip incomplete" IDEA_VERSION="IU-2017.3.5" PHP_PLUGIN_VERSION="173.4301.34" TWIG_PLUGIN_VERSION="173.4301.7" TOOLBOX_PLUGIN_VERSION="0.4.6" ANNOTATION_PLUGIN_VERSION="5.2.1"
2828

gradle.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ideaVersion = IU-182.2949.4
2-
phpPluginVersion = 182.2949.27
3-
twigPluginVersion = 182.2757.22
1+
ideaVersion = IU-2018.2
2+
phpPluginVersion = 182.3684.42
3+
twigPluginVersion = 182.3458.35
44
toolboxPluginVersion = 0.4.6
55
annotationPluginVersion = 5.3
66

src/main/java/fr/adrienbrault/idea/symfony2plugin/doctrine/metadata/util/DoctrineMetadataUtil.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ public static String findModelNameInScope(@NotNull PsiElement psiElement) {
316316
if(yamlDocument != null) {
317317
YAMLValue topLevelValue = yamlDocument.getTopLevelValue();
318318
if(topLevelValue instanceof YAMLMapping) {
319-
PsiElement firstChild = topLevelValue.getFirstChild();
320-
if(firstChild instanceof YAMLKeyValue) {
321-
String keyText = ((YAMLKeyValue) firstChild).getKeyText();
319+
YAMLKeyValue firstChild = PsiTreeUtil.findChildOfType(topLevelValue, YAMLKeyValue.class);
320+
if(firstChild != null) {
321+
String keyText = firstChild.getKeyText();
322322
if(StringUtils.isNotBlank(keyText)) {
323323
return keyText;
324324
}

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/doctrine/metadata/util/DoctrineMetadataUtilTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import fr.adrienbrault.idea.symfony2plugin.util.PhpElementsUtil;
1616
import org.jetbrains.yaml.YAMLFileType;
1717

18-
import java.io.File;
1918
import java.util.*;
2019

2120
/**
@@ -236,7 +235,7 @@ public void testYamlFindModelNameInScope() {
236235
}) {
237236
myFixture.configureByText(YAMLFileType.YML, s);
238237
PsiElement psiElement = myFixture.getFile().findElementAt(myFixture.getCaretOffset());
239-
assertEquals("Foo\\Foo", DoctrineMetadataUtil.findModelNameInScope(psiElement));
238+
assertEquals(String.format("Fixture %s", s), "Foo\\Foo", DoctrineMetadataUtil.findModelNameInScope(psiElement));
240239
}
241240
}
242241
}

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/intentions/yaml/dic/YamlCreateServiceArgumentsCallbackTest.java

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.adrienbrault.idea.symfony2plugin.tests.intentions.yaml.dic;
22

3+
import com.intellij.openapi.application.ApplicationInfo;
34
import com.intellij.openapi.application.ApplicationManager;
45
import com.intellij.openapi.command.CommandProcessor;
56
import com.intellij.psi.util.PsiTreeUtil;
@@ -47,14 +48,26 @@ public void run() {
4748
}
4849
}, null, null);
4950

50-
assertEquals("" +
51-
"services:\n" +
52-
" foo:\n" +
53-
" class: Foo\\Foo\n" +
54-
" arguments: ['@foo', '@?', '@?']\n",
55-
yamlFile.getText()
56-
);
57-
51+
ApplicationInfo instance = ApplicationInfo.getInstance();
52+
String minorVersion = instance.getMinorVersion();
53+
if ((instance.getMajorVersion().equals("2018") && Integer.valueOf(minorVersion) >= 2)) {
54+
assertEquals("" +
55+
"services:\n" +
56+
" foo:\n" +
57+
" class: Foo\\Foo\n" +
58+
" arguments:\n" +
59+
" ['@foo', '@?', '@?']\n",
60+
yamlFile.getText()
61+
);
62+
} else {
63+
assertEquals("" +
64+
"services:\n" +
65+
" foo:\n" +
66+
" class: Foo\\Foo\n" +
67+
" arguments: ['@foo', '@?', '@?']\n",
68+
yamlFile.getText()
69+
);
70+
}
5871
}
5972

6073
}

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/util/yaml/YamlHelperLightTest.java

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fr.adrienbrault.idea.symfony2plugin.tests.util.yaml;
22

3+
import com.intellij.openapi.application.ApplicationInfo;
34
import com.intellij.psi.PsiElement;
45
import com.intellij.util.Function;
56
import com.intellij.util.containers.ContainerUtil;
@@ -16,10 +17,8 @@
1617
import org.jetbrains.yaml.psi.YAMLFile;
1718
import org.jetbrains.yaml.psi.YAMLKeyValue;
1819
import org.jetbrains.yaml.psi.YAMLScalar;
19-
import org.jetbrains.yaml.psi.impl.YAMLArrayImpl;
2020
import org.jetbrains.yaml.psi.impl.YAMLHashImpl;
2121

22-
import java.io.File;
2322
import java.util.ArrayList;
2423
import java.util.Collection;
2524
import java.util.List;
@@ -338,16 +337,31 @@ public void testInsertKeyWithArrayValue() {
338337

339338
YamlHelper.insertKeyIntoFile(yamlFile, yamlKeyValue, "services");
340339

341-
assertEquals("" +
342-
"services:\n" +
343-
" foo:\n" +
344-
" car: test\n" +
345-
" my_service:\n" +
346-
" class: foo\n" +
347-
" tag:\n" +
348-
" - foo",
349-
yamlFile.getText()
350-
);
340+
ApplicationInfo instance = ApplicationInfo.getInstance();
341+
String minorVersion = instance.getMinorVersion();
342+
if ((instance.getMajorVersion().equals("2018") && Integer.valueOf(minorVersion) >= 2)) {
343+
assertEquals("" +
344+
"services:\n" +
345+
" foo:\n" +
346+
" car: test\n" +
347+
" my_service:\n" +
348+
" class: foo\n" +
349+
" tag:\n" +
350+
" - foo",
351+
yamlFile.getText()
352+
);
353+
} else {
354+
assertEquals("" +
355+
"services:\n" +
356+
" foo:\n" +
357+
" car: test\n" +
358+
" my_service:\n" +
359+
" class: foo\n" +
360+
" tag:\n" +
361+
" - foo",
362+
yamlFile.getText()
363+
);
364+
}
351365
}
352366

353367
/**
@@ -366,14 +380,27 @@ public void testInsertKeyValueWithMissingMainKeyInRoot() {
366380

367381
YamlHelper.insertKeyIntoFile(yamlFile, yamlKeyValue, "services");
368382

369-
assertEquals("" +
370-
"foo: foo\n" +
371-
"services:\n" +
372-
" my_service:\n" +
373-
" class: foo\n" +
374-
" tag: foo",
375-
yamlFile.getText()
376-
);
383+
ApplicationInfo instance = ApplicationInfo.getInstance();
384+
String minorVersion = instance.getMinorVersion();
385+
if ((instance.getMajorVersion().equals("2018") && Integer.valueOf(minorVersion) >= 2)) {
386+
assertEquals("" +
387+
"foo: foo\n" +
388+
"services:\n" +
389+
" my_service:\n" +
390+
" class: foo\n" +
391+
" tag: foo",
392+
yamlFile.getText()
393+
);
394+
}else {
395+
assertEquals("" +
396+
"foo: foo\n" +
397+
"services:\n" +
398+
" my_service:\n" +
399+
" class: foo\n" +
400+
" tag: foo",
401+
yamlFile.getText()
402+
);
403+
}
377404
}
378405

379406
/**

0 commit comments

Comments
 (0)