mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
- Sets `client_max_body_size 128M` in `http` section of `nginx.conf` so it covers all configs - Adds `php-memory-limits.conf` to `php-fpm` conf folder, to set `memory_limit`, `upload_max_filesize`, `post_max_size` all to 128M (Updates #253 by moving config location to cover all, since #253 didn't cover secure configs, etc)
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
|
|
use Valet\PhpFpm;
|
|
use Illuminate\Container\Container;
|
|
|
|
class PhpFpmTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
public function setUp()
|
|
{
|
|
$_SERVER['SUDO_USER'] = user();
|
|
|
|
Container::setInstance(new Container);
|
|
}
|
|
|
|
|
|
public function tearDown()
|
|
{
|
|
exec('rm -rf '.__DIR__.'/output');
|
|
mkdir(__DIR__.'/output');
|
|
touch(__DIR__.'/output/.gitkeep');
|
|
|
|
Mockery::close();
|
|
}
|
|
|
|
public function test_fpm_is_configured_with_the_correct_user_group_and_port()
|
|
{
|
|
copy(__DIR__.'/files/fpm.conf', __DIR__.'/output/fpm.conf');
|
|
mkdir(__DIR__.'/output/conf.d');
|
|
copy(__DIR__.'/files/php-memory-limits.ini', __DIR__.'/output/conf.d/php-memory-limits.ini');
|
|
resolve(StubForUpdatingFpmConfigFiles::class)->updateConfiguration();
|
|
$contents = file_get_contents(__DIR__.'/output/fpm.conf');
|
|
$this->assertContains(sprintf("\nuser = %s", user()), $contents);
|
|
$this->assertContains("\ngroup = staff", $contents);
|
|
$this->assertContains("\nlisten = ".VALET_HOME_PATH."/valet.sock", $contents);
|
|
}
|
|
}
|
|
|
|
|
|
class StubForUpdatingFpmConfigFiles extends PhpFpm
|
|
{
|
|
function fpmConfigPath()
|
|
{
|
|
return __DIR__.'/output/fpm.conf';
|
|
}
|
|
}
|