From 148eb0174d945c73f275c3251c28421f0cd86f3b Mon Sep 17 00:00:00 2001 From: Matt Stauffer Date: Sun, 13 Mar 2022 22:29:09 -0400 Subject: [PATCH] Drop test coverage for deprecated method --- tests/PhpFpmTest.php | 81 -------------------------------------------- 1 file changed, 81 deletions(-) diff --git a/tests/PhpFpmTest.php b/tests/PhpFpmTest.php index 9d810af..fa7caf3 100644 --- a/tests/PhpFpmTest.php +++ b/tests/PhpFpmTest.php @@ -114,83 +114,6 @@ public function test_utilized_php_versions() $this->assertEquals(['php@7.1', 'php@7.2', 'php@7.3'], resolve(PhpFpm::class)->utilizedPhpVersions()); } - public function test_global_php_version_update_will_swap_socks() - { - $this->markTestIncomplete('Needs deleting or refactoring'); - - $fileSystemMock = Mockery::mock(Filesystem::class); - - $phpFpmMock = Mockery::mock(PhpFpm::class, [ - Mockery::mock(Brew::class), - Mockery::mock(CommandLine::class), - $fileSystemMock, - resolve(Configuration::class), - Mockery::mock(Site::class), - Mockery::mock(Nginx::class), - ])->makePartial(); - - swap(PhpFpm::class, $phpFpmMock); - - $fileSystemMock->shouldReceive('scandir') - ->once() - ->with(VALET_HOME_PATH.'/Nginx') - ->andReturn([ - '.gitkeep', - 'isolated-site-71.test', - 'isolated-site-72.test', - 'isolated-site-73.test', - 'non-isolated-site.test', - ]); - - // Skip dotfiles - $fileSystemMock->shouldNotReceive('get')->with(VALET_HOME_PATH.'/Nginx/.gitkeep'); - - // Any isolated site running on php72 would be replaced with default valet.sock, - // as 72 will be the default version after the global PHP version switch - $fileSystemMock->shouldReceive('get') - ->once() - ->with(VALET_HOME_PATH.'/Nginx/isolated-site-72.test') - ->andReturn('# Valet isolated PHP version : 72'.PHP_EOL.'server { fastcgi_pass: valet72.sock }'); - - $fileSystemMock->shouldReceive('put')->once()->withArgs([ - VALET_HOME_PATH.'/Nginx/isolated-site-72.test', - '# Valet isolated PHP version : 72'.PHP_EOL.'server { fastcgi_pass: valet.sock }', - ]); - - // Any isolated site running on current PHP version (with valet.sock), - // should be still be running on the same version after the global version update - $fileSystemMock->shouldReceive('get') - ->once() - ->with(VALET_HOME_PATH.'/Nginx/isolated-site-71.test') - ->andReturn('# Valet isolated PHP version : 71'.PHP_EOL.'server { fastcgi_pass: valet.sock }'); - - $fileSystemMock->shouldReceive('put')->once()->withArgs([ - VALET_HOME_PATH.'/Nginx/isolated-site-71.test', - '# Valet isolated PHP version : 71'.PHP_EOL.'server { fastcgi_pass: valet71.sock }', - ]); - - // PHP 7.3 sites won't be affected here - $fileSystemMock->shouldReceive('get') - ->once() - ->with(VALET_HOME_PATH.'/Nginx/isolated-site-73.test') - ->andReturn('# Valet isolated PHP version : 73'.PHP_EOL.'server { fastcgi_pass: valet73.sock }'); - - $fileSystemMock->shouldNotReceive('put')->withArgs([ - VALET_HOME_PATH.'/Nginx/isolated-site-73.test', - Mockery::any(), - ]); - - // Nginx config that doesn't have the isolation header, It would not swap .sock files - $fileSystemMock->shouldReceive('get')->once()->with(VALET_HOME_PATH.'/Nginx/non-isolated-site.test')->andReturn('valet.sock'); - $fileSystemMock->shouldNotReceive('put')->withArgs([ - VALET_HOME_PATH.'/Nginx/non-isolated-site.test', - 'valet71.sock', - ]); - - // Switching from php7.1 to php7.2 - resolve(PhpFpm::class)->updateConfigurationForGlobalUpdate('php@7.2', 'php@7.1'); - } - public function test_stop_unused_php_versions() { $brewMock = Mockery::mock(Brew::class); @@ -323,9 +246,6 @@ public function test_use_version_if_already_linked_php_will_unlink_before_instal $cliMock->shouldReceive('quietly')->with('sudo rm '.VALET_HOME_PATH.'/valet.sock')->once(); $fileSystemMock->shouldReceive('unlink')->with(VALET_HOME_PATH.'/valet.sock')->once(); - // $phpFpmMock->shouldReceive('createConfigurationFiles')->with('php@7.1')->once(); - // $phpFpmMock->shouldReceive('updateConfigurationForGlobalUpdate')->withArgs(['php@7.2', 'php@7.1'])->once(); - $brewMock->shouldReceive('supportedPhpVersions')->andReturn(collect([ 'php@7.2', 'php@7.1', @@ -389,7 +309,6 @@ public function test_isolate_will_isolate_a_site() $brewMock->shouldNotReceive('unlink'); $phpFpmMock->shouldNotReceive('stopRunning'); $phpFpmMock->shouldNotReceive('install'); - // $phpFpmMock->shouldNotReceive('updateConfigurationForGlobalUpdate'); $this->assertSame(null, $phpFpmMock->isolateDirectory('test', 'php@7.2')); }