mirror of
https://github.com/filegator/filegator.git
synced 2025-08-21 06:31:56 +02:00
Test enhancement (#18)
Wow! Thank you very much for fixing all this. Cheers!
This commit is contained in:
committed by
Milos Stojanovic
parent
c7d88635b4
commit
ea6933883f
@@ -13,7 +13,6 @@ namespace Tests\Unit;
|
||||
use Filegator\Kernel\Request;
|
||||
use Filegator\Kernel\Response;
|
||||
use Filegator\Services\Auth\AuthInterface;
|
||||
use Filegator\Services\Session\Session;
|
||||
use Filegator\Services\Session\SessionStorageInterface;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -55,7 +54,7 @@ class AppTest extends TestCase
|
||||
|
||||
$config = $this->getMockConfig();
|
||||
|
||||
$app1 = $this->bootFreshApp($config, $request1, null, true);
|
||||
$this->bootFreshApp($config, $request1, null, true);
|
||||
$prev_session = $request1->getSession();
|
||||
|
||||
// another request with previous session
|
||||
|
@@ -21,7 +21,7 @@ class AuthTest extends TestCase
|
||||
{
|
||||
public function testSuccessfulLogin()
|
||||
{
|
||||
$ret = $this->sendRequest('POST', '/login', [
|
||||
$this->sendRequest('POST', '/login', [
|
||||
'username' => 'john@example.com',
|
||||
'password' => 'john123',
|
||||
]);
|
||||
|
@@ -11,6 +11,7 @@
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -19,14 +20,14 @@ class FilesTest extends TestCase
|
||||
{
|
||||
protected $timestamp;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resetTempDir();
|
||||
|
||||
$this->timestamp = time();
|
||||
}
|
||||
|
||||
public function tearDown(): void
|
||||
protected function tearDown(): void
|
||||
{
|
||||
$this->resetTempDir();
|
||||
}
|
||||
@@ -234,7 +235,7 @@ class FilesTest extends TestCase
|
||||
$username = 'john@example.com';
|
||||
$this->signIn($username, 'john123');
|
||||
|
||||
$this->expectException(\Exception::class);
|
||||
$this->expectException(Exception::class);
|
||||
|
||||
$this->sendRequest('POST', '/renameitem', [
|
||||
'from' => 'missing.txt',
|
||||
@@ -256,7 +257,7 @@ class FilesTest extends TestCase
|
||||
],
|
||||
];
|
||||
|
||||
$this->expectException(\Exception::class);
|
||||
$this->expectException(Exception::class);
|
||||
|
||||
$this->sendRequest('POST', '/deleteitems', [
|
||||
'items' => $items,
|
||||
@@ -351,7 +352,7 @@ class FilesTest extends TestCase
|
||||
],
|
||||
];
|
||||
|
||||
$this->expectException(\Exception::class);
|
||||
$this->expectException(Exception::class);
|
||||
|
||||
$this->sendRequest('POST', '/copyitems', [
|
||||
'items' => $items,
|
||||
|
@@ -18,7 +18,7 @@ use Tests\TestCase;
|
||||
*/
|
||||
class UploadTest extends TestCase
|
||||
{
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resetTempDir();
|
||||
|
||||
|
Reference in New Issue
Block a user