@@ -52,11 +52,7 @@ public function testDemoApplicationInstallation()
5252 $ this ->assertContains ('Downloading the Symfony Demo Application ' , $ output );
5353 $ this ->assertContains ('Symfony Demo Application was successfully installed. ' , $ output );
5454
55- $ output = $ this ->runCommand ('php bin/console --version ' , $ projectDir );
56- $ this ->assertRegExp ('/Symfony version 3\.\d+\.\d+(-DEV)? - app\/dev\/debug/ ' , $ output );
57-
5855 $ composerConfig = json_decode (file_get_contents ($ projectDir .'/composer.json ' ), true );
59-
6056 $ this ->assertArrayNotHasKey ('platform ' , $ composerConfig ['config ' ], 'The composer.json file does not define any platform configuration. ' );
6157 }
6258
@@ -65,7 +61,7 @@ public function testDemoApplicationInstallation()
6561 */
6662 public function testSymfonyInstallation ($ versionToInstall , $ messageRegexp , $ versionRegexp , $ requiredPhpVersion )
6763 {
68- if (version_compare (phpversion () , $ requiredPhpVersion , '< ' )) {
64+ if (version_compare (PHP_VERSION , $ requiredPhpVersion , '< ' )) {
6965 $ this ->markTestSkipped (sprintf ('This test requires PHP %s or higher. ' , $ requiredPhpVersion ));
7066 }
7167
@@ -76,14 +72,10 @@ public function testSymfonyInstallation($versionToInstall, $messageRegexp, $vers
7672 $ this ->assertContains ('Downloading Symfony... ' , $ output );
7773 $ this ->assertRegExp ($ messageRegexp , $ output );
7874
79- if ('3 ' === substr ($ versionToInstall , 0 , 1 ) || '' === $ versionToInstall ) {
80- if (PHP_VERSION_ID < 50500 ) {
81- $ this ->markTestSkipped ('Symfony 3 requires PHP 5.5.9 or higher. ' );
82- }
83-
84- $ output = $ this ->runCommand ('php bin/console --version ' , $ projectDir );
85- } else {
75+ if (file_exists ($ projectDir .'/app/console ' )) {
8676 $ output = $ this ->runCommand ('php app/console --version ' , $ projectDir );
77+ } else {
78+ $ output = $ this ->runCommand ('php bin/console --version ' , $ projectDir );
8779 }
8880
8981 $ this ->assertRegExp ($ versionRegexp , $ output );
@@ -122,6 +114,17 @@ public function testSymfonyInstallationInCurrentDirectory()
122114 $ this ->assertContains ('Symfony version 2.7.5 - app/dev/debug ' , $ output );
123115 }
124116
117+ public function testSymfonyDemoInstallationWithNewCommand ()
118+ {
119+ if (PHP_VERSION_ID < 50500 ) {
120+ $ this ->markTestSkipped ('This test requires PHP 5.5 or higher. ' );
121+ }
122+
123+ $ output = $ this ->runCommand (sprintf ('php %s/symfony.phar new demo 3.4 ' , $ this ->rootDir ));
124+ $ this ->assertContains ("If you want to download the Symfony Demo app, execute 'symfony demo' instead of 'symfony new demo' " , $ output );
125+ $ this ->fs ->remove ('demo ' );
126+ }
127+
125128 /**
126129 * Runs the given string as a command and returns the resulting output.
127130 * The CWD is set to the root project directory to simplify command paths.
@@ -150,13 +153,6 @@ private function runCommand($command, $workingDirectory = null)
150153 public function provideSymfonyInstallationData ()
151154 {
152155 return array (
153- array (
154- '' ,
155- '/.*Symfony 3\.1\.\d+ was successfully installed.*/ ' ,
156- '/Symfony version 3\.1\.\d+(-DEV)? - app\/dev\/debug/ ' ,
157- '5.5.9 ' ,
158- ),
159-
160156 array (
161157 '3.0 ' ,
162158 '/.*Symfony 3\.0\.\d+ was successfully installed.*/ ' ,
@@ -166,9 +162,9 @@ public function provideSymfonyInstallationData()
166162
167163 array (
168164 'lts ' ,
169- '/.*Symfony 2\.8 \.\d+ was successfully installed.*/ ' ,
170- '/Symfony version 2\.8 \.\d+(-DEV)? - app\/ dev\/ debug/ ' ,
171- '5.3 .9 ' ,
165+ '/.*Symfony 3\.4 \.\d+ was successfully installed.*/ ' ,
166+ '/Symfony 3\.4 \.\d+ \(kernel: app, env: dev, debug: true\) / ' ,
167+ '5.5 .9 ' ,
172168 ),
173169
174170 array (
0 commit comments