mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-02-20 01:21:20 +01:00
CS fixes in tests
This commit is contained in:
@@ -10,22 +10,10 @@ use Roundcube\Tests\ServerTestCase;
|
||||
*/
|
||||
class StaticTest extends ServerTestCase
|
||||
{
|
||||
/**
|
||||
* Dataset for testExistingResources()
|
||||
*/
|
||||
public static function provideExistingResources(): iterable
|
||||
{
|
||||
return [
|
||||
['program/resources/blank.gif', 'image/gif'],
|
||||
['skins/elastic/images/logo.svg?s=1234567', 'image/svg+xml'],
|
||||
['plugins/acl/acl.js', 'text/javascript'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test valid resources
|
||||
*/
|
||||
#[DataProvider('provideExistingResources')]
|
||||
#[DataProvider('provide_ExistingResources_cases')]
|
||||
public function testExistingResources($path, $ctype): void
|
||||
{
|
||||
$response = $this->request('GET', 'static.php/' . $path);
|
||||
@@ -41,10 +29,34 @@ class StaticTest extends ServerTestCase
|
||||
// TODO: Expires and Last-Modified header
|
||||
}
|
||||
|
||||
/**
|
||||
* Dataset for testExistingResources()
|
||||
*/
|
||||
public static function provide_ExistingResources_cases(): iterable
|
||||
{
|
||||
return [
|
||||
['program/resources/blank.gif', 'image/gif'],
|
||||
['skins/elastic/images/logo.svg?s=1234567', 'image/svg+xml'],
|
||||
['plugins/acl/acl.js', 'text/javascript'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test forbidden resources
|
||||
*/
|
||||
#[DataProvider('provide_ForbiddenResources_cases')]
|
||||
public function testForbiddenResources($path): void
|
||||
{
|
||||
$response = $this->request('GET', 'static.php/' . $path);
|
||||
|
||||
$this->assertSame(404, $response->getStatusCode());
|
||||
$this->assertSame('', (string) $response->getBody());
|
||||
}
|
||||
|
||||
/**
|
||||
* Dataset for testForbiddenResources()
|
||||
*/
|
||||
public static function provideForbiddenResources(): iterable
|
||||
public static function provide_ForbiddenResources_cases(): iterable
|
||||
{
|
||||
return [
|
||||
[''],
|
||||
@@ -60,18 +72,6 @@ class StaticTest extends ServerTestCase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test forbidden resources
|
||||
*/
|
||||
#[DataProvider('provideForbiddenResources')]
|
||||
public function testForbiddenResources($path): void
|
||||
{
|
||||
$response = $this->request('GET', 'static.php/' . $path);
|
||||
|
||||
$this->assertSame(404, $response->getStatusCode());
|
||||
$this->assertSame('', (string) $response->getBody());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test handling of Modified-Since header
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user