1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Add test coverage for setting FPM socket

This commit is contained in:
Adam Wathan
2016-09-24 10:25:42 -04:00
parent 2bc9ea90b1
commit 5e365f4bfb
2 changed files with 5 additions and 4 deletions

View File

@@ -22,14 +22,14 @@ public function tearDown()
Mockery::close();
}
public function test_update_configuration_replaces_user_and_group_in_config_file()
public function test_fpm_is_configured_with_the_correct_user_group_and_socket()
{
copy(__DIR__.'/files/fpm.conf', __DIR__.'/output/fpm.conf');
resolve(StubForUpdatingFpmConfigFiles::class)->updateConfiguration();
$contents = file_get_contents(__DIR__.'/output/fpm.conf');
$this->assertTrue(strpos($contents, 'user = '.user()) !== false);
$this->assertTrue(strpos($contents, 'group = staff') !== false);
$this->assertTrue(strpos($contents, sprintf("\nuser = %s", user())) !== false);
$this->assertTrue(strpos($contents, "\ngroup = staff") !== false);
$this->assertTrue(strpos($contents, "\nlisten = /var/run/valet/fpm.socket") !== false);
}
}