1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-24 07:42:07 +03:00

Mail: Removed custom symfony/mailer fork

Moved to standard symfony mailer now that my patches have been
upstreamed. This changes the config to work with the symfony option,
following the same overall logic.
Also updated testing to allow test runs via mulitple custom env options.

Closes #5636
This commit is contained in:
Dan Brown
2025-07-15 15:24:31 +01:00
parent 2442829ef2
commit d13abc7e1d
8 changed files with 155 additions and 158 deletions

View File

@ -17,7 +17,7 @@ class SecurityHeaderTest extends TestCase
public function test_cookies_samesite_none_when_iframe_hosts_set()
{
$this->runWithEnv('ALLOWED_IFRAME_HOSTS', 'http://example.com', function () {
$this->runWithEnv(['ALLOWED_IFRAME_HOSTS' => 'http://example.com'], function () {
$resp = $this->get('/');
foreach ($resp->headers->getCookies() as $cookie) {
$this->assertEquals('none', $cookie->getSameSite());
@ -27,14 +27,14 @@ class SecurityHeaderTest extends TestCase
public function test_secure_cookies_controlled_by_app_url()
{
$this->runWithEnv('APP_URL', 'http://example.com', function () {
$this->runWithEnv(['APP_URL' => 'http://example.com'], function () {
$resp = $this->get('/');
foreach ($resp->headers->getCookies() as $cookie) {
$this->assertFalse($cookie->isSecure());
}
});
$this->runWithEnv('APP_URL', 'https://example.com', function () {
$this->runWithEnv(['APP_URL' => 'https://example.com'], function () {
$resp = $this->get('/');
foreach ($resp->headers->getCookies() as $cookie) {
$this->assertTrue($cookie->isSecure());
@ -52,7 +52,7 @@ class SecurityHeaderTest extends TestCase
public function test_iframe_csp_includes_extra_hosts_if_configured()
{
$this->runWithEnv('ALLOWED_IFRAME_HOSTS', 'https://a.example.com https://b.example.com', function () {
$this->runWithEnv(['ALLOWED_IFRAME_HOSTS' => 'https://a.example.com https://b.example.com'], function () {
$resp = $this->get('/');
$frameHeader = $this->getCspHeader($resp, 'frame-ancestors');