File tree Expand file tree Collapse file tree 1 file changed +26
-10
lines changed
src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/util/yaml Expand file tree Collapse file tree 1 file changed +26
-10
lines changed Original file line number Diff line number Diff line change 11package fr .adrienbrault .idea .symfony2plugin .tests .util .yaml ;
22
3+ import com .intellij .openapi .application .ApplicationInfo ;
34import com .intellij .psi .PsiElement ;
45import com .intellij .util .Function ;
56import com .intellij .util .containers .ContainerUtil ;
@@ -336,16 +337,31 @@ public void testInsertKeyWithArrayValue() {
336337
337338 YamlHelper .insertKeyIntoFile (yamlFile , yamlKeyValue , "services" );
338339
339- assertEquals ("" +
340- "services:\n " +
341- " foo:\n " +
342- " car: test\n " +
343- " my_service:\n " +
344- " class: foo\n " +
345- " tag:\n " +
346- " - foo" ,
347- yamlFile .getText ()
348- );
340+ ApplicationInfo instance = ApplicationInfo .getInstance ();
341+ String minorVersion = instance .getMinorVersionMainPart ();
342+ if (instance .getMajorVersion ().equals ("2019" ) || (instance .getMajorVersion ().equals ("2018" ) && Integer .valueOf (minorVersion ) >= 3 )) {
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+ }
349365 }
350366
351367 /**
You can’t perform that action at this time.
0 commit comments