-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change magic isolation config string to "ISOLATED_PHP_VERSION"
Co-Authored-By: Jacob Baker-Kretzmar <[email protected]>
- v4.8.2
- v4.8.1
- v4.8.0
- v4.7.1
- v4.7.0
- v4.6.3
- v4.6.2
- v4.6.1
- v4.6.0
- v4.5.0
- v4.4.1
- v4.4.0
- v4.3.0
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0-beta.1
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.13
- v3.1.12
- v3.1.11
- v3.1.10
- v3.1.9
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.1
- v3.0.0
- v3.0.0-alpha.3
- v3.0.0-alpha.2
- v3.0.0-alpha.1
- v3.0.0-alpha
1 parent
e4c7a9b
commit 383aa62
Showing
6 changed files
with
22 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,15 +98,15 @@ public function test_utilized_php_versions() | |
$sites = [ | ||
[ | ||
'site' => 'isolated-site-71.test', | ||
'conf' => '# Valet isolated PHP version: 71'.PHP_EOL.'valet71.sock', | ||
'conf' => '# '.ISOLATED_PHP_VERSION.'=71'.PHP_EOL.'valet71.sock', | ||
], | ||
[ | ||
'site' => 'isolated-site-72.test', | ||
'conf' => '# Valet isolated PHP version: [email protected]'.PHP_EOL.'valet72.sock', | ||
'conf' => '# '.ISOLATED_PHP_VERSION.'=[email protected]'.PHP_EOL.'valet72.sock', | ||
], | ||
[ | ||
'site' => 'isolated-site-73.test', | ||
'conf' => '# Valet isolated PHP version: 73'.PHP_EOL.'valet.sock', | ||
'conf' => '# '.ISOLATED_PHP_VERSION.'=73'.PHP_EOL.'valet.sock', | ||
], | ||
]; | ||
|
||
|
@@ -146,11 +146,11 @@ public function test_it_lists_isolated_directories() | |
$sites = [ | ||
[ | ||
'site' => 'isolated-site-71.test', | ||
'conf' => '# Valet isolated PHP version: 71'.PHP_EOL.'valet71.sock', | ||
'conf' => '# '.ISOLATED_PHP_VERSION.'=71'.PHP_EOL.'valet71.sock', | ||
], | ||
[ | ||
'site' => 'isolated-site-72.test', | ||
'conf' => '# Valet isolated PHP version: [email protected]'.PHP_EOL.'valet72.sock', | ||
'conf' => '# '.ISOLATED_PHP_VERSION.'=[email protected]'.PHP_EOL.'valet72.sock', | ||
], | ||
[ | ||
'site' => 'not-isolated-site.test', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -659,13 +659,13 @@ public function test_can_install_nginx_site_config_for_specific_php_version() | |
$files->shouldReceive('get') | ||
->once() | ||
->with($siteMock->nginxPath('site1.test')) | ||
->andReturn('# Valet isolated PHP version: [email protected]'.PHP_EOL.'server { fastcgi_pass: valet74.sock }'); | ||
->andReturn('# '.ISOLATED_PHP_VERSION.'=[email protected]'.PHP_EOL.'server { fastcgi_pass: valet74.sock }'); | ||
|
||
$files->shouldReceive('putAsUser') | ||
->once() | ||
->withArgs([ | ||
$siteMock->nginxPath('site1.test'), | ||
'# Valet isolated PHP version: [email protected]'.PHP_EOL.'server { fastcgi_pass: valet80.sock }', | ||
'# '.ISOLATED_PHP_VERSION.'=[email protected]'.PHP_EOL.'server { fastcgi_pass: valet80.sock }', | ||
]); | ||
|
||
$siteMock->isolate('site1.test', '[email protected]'); | ||
|
@@ -682,7 +682,7 @@ public function test_can_install_nginx_site_config_for_specific_php_version() | |
->withArgs([ | ||
$siteMock->nginxPath('site2.test'), | ||
Mockery::on(function ($argument) { | ||
return preg_match('/^# Valet isolated PHP version: [email protected]/', $argument) | ||
return preg_match('/^# '.ISOLATED_PHP_VERSION.'=[email protected]/', $argument) | ||
&& preg_match('#fastcgi_pass "unix:.*/valet80.sock#', $argument) | ||
&& strpos($argument, 'server_name site2.test www.site2.test *.site2.test;') !== false; | ||
}), | ||
|
@@ -733,7 +733,7 @@ public function test_retrieves_custom_php_version_from_nginx_config() | |
$files->shouldReceive('get') | ||
->once() | ||
->with($siteMock->nginxPath('site1.test')) | ||
->andReturn('# Valet isolated PHP version: [email protected]'); | ||
->andReturn('# '.ISOLATED_PHP_VERSION.'=[email protected]'); | ||
$this->assertEquals('74', resolve(Site::class)->customPhpVersion('site1.test')); | ||
|
||
// Site without any custom nginx config | ||
|
@@ -757,28 +757,28 @@ public function test_replace_sock_file_in_nginx_config() | |
// When switching to php71, valet71.sock should be replaced with valet.sock; | ||
// isolation header should be prepended | ||
$this->assertEquals( | ||
'# Valet isolated PHP version: 71'.PHP_EOL.'server { fastcgi_pass: valet71.sock }', | ||
'# '.ISOLATED_PHP_VERSION.'=71'.PHP_EOL.'server { fastcgi_pass: valet71.sock }', | ||
$site->replaceSockFile('server { fastcgi_pass: valet71.sock }', '71') | ||
); | ||
|
||
// When switching to php72, valet.sock should be replaced with valet72.sock | ||
$this->assertEquals( | ||
'# Valet isolated PHP version: 72'.PHP_EOL.'server { fastcgi_pass: valet72.sock }', | ||
'# '.ISOLATED_PHP_VERSION.'=72'.PHP_EOL.'server { fastcgi_pass: valet72.sock }', | ||
$site->replaceSockFile('server { fastcgi_pass: valet.sock }', '72') | ||
); | ||
|
||
// When switching to php73 from php72, valet72.sock should be replaced with valet73.sock; | ||
// isolation header should be updated to [email protected] | ||
$this->assertEquals( | ||
'# Valet isolated PHP version: 73'.PHP_EOL.'server { fastcgi_pass: valet73.sock }', | ||
$site->replaceSockFile('# Valet isolated PHP version: 72'.PHP_EOL.'server { fastcgi_pass: valet72.sock }', '73') | ||
'# '.ISOLATED_PHP_VERSION.'=73'.PHP_EOL.'server { fastcgi_pass: valet73.sock }', | ||
$site->replaceSockFile('# '.ISOLATED_PHP_VERSION.'=72'.PHP_EOL.'server { fastcgi_pass: valet72.sock }', '73') | ||
); | ||
|
||
// When switching to php72 from php74, valet72.sock should be replaced with valet74.sock; | ||
// isolation header should be updated to [email protected] | ||
$this->assertEquals( | ||
'# Valet isolated PHP version: [email protected]'.PHP_EOL.'server { fastcgi_pass: valet74.sock }', | ||
$site->replaceSockFile('# Valet isolated PHP version: 72'.PHP_EOL.'server { fastcgi_pass: valet.sock }', '[email protected]') | ||
'# '.ISOLATED_PHP_VERSION.'=[email protected]'.PHP_EOL.'server { fastcgi_pass: valet74.sock }', | ||
$site->replaceSockFile('# '.ISOLATED_PHP_VERSION.'=72'.PHP_EOL.'server { fastcgi_pass: valet.sock }', '[email protected]') | ||
); | ||
} | ||
|
||
|