-
-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
157 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* We don't care for unhandled exceptions in tests. | ||
* It is the nature of a test to throw an exception. | ||
* Without this suppression we had 100+ Linter warning in this file which | ||
* don't help anything. | ||
* | ||
* @noinspection PhpDocMissingThrowsInspection | ||
* @noinspection PhpUnhandledExceptionInspection | ||
*/ | ||
|
||
namespace Tests\Feature_v2; | ||
|
||
use Tests\Feature_v2\Base\BaseApiV2Test; | ||
|
||
class LandingTest extends BaseApiV2Test | ||
{ | ||
public function testGet(): void | ||
{ | ||
$response = $this->getJson('LandingPage'); | ||
$this->assertOk($response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
/** | ||
* We don't care for unhandled exceptions in tests. | ||
* It is the nature of a test to throw an exception. | ||
* Without this suppression we had 100+ Linter warning in this file which | ||
* don't help anything. | ||
* | ||
* @noinspection PhpDocMissingThrowsInspection | ||
* @noinspection PhpUnhandledExceptionInspection | ||
*/ | ||
|
||
namespace Tests\Feature_v2\Maintenance; | ||
|
||
use Tests\Feature_v2\Base\BaseApiV2Test; | ||
|
||
class MissingFileSizeTest extends BaseApiV2Test | ||
{ | ||
public function testGuest(): void | ||
{ | ||
$response = $this->getJsonWithData('Maintenance::missingFileSize'); | ||
$this->assertUnauthorized($response); | ||
|
||
$response = $this->postJson('Maintenance::missingFileSize'); | ||
$this->assertUnauthorized($response); | ||
} | ||
|
||
public function testUser(): void | ||
{ | ||
$response = $this->actingAs($this->userLocked)->getJsonWithData('Maintenance::missingFileSize'); | ||
$this->assertForbidden($response); | ||
|
||
$response = $this->actingAs($this->userLocked)->postJson('Maintenance::missingFileSize'); | ||
$this->assertForbidden($response); | ||
} | ||
|
||
public function testAdmin(): void | ||
{ | ||
$response = $this->actingAs($this->admin)->getJsonWithData('Maintenance::missingFileSize'); | ||
$this->assertOk($response); | ||
|
||
$response = $this->actingAs($this->admin)->postJson('Maintenance::missingFileSize'); | ||
$this->assertNoContent($response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* We don't care for unhandled exceptions in tests. | ||
* It is the nature of a test to throw an exception. | ||
* Without this suppression we had 100+ Linter warning in this file which | ||
* don't help anything. | ||
* | ||
* @noinspection PhpDocMissingThrowsInspection | ||
* @noinspection PhpUnhandledExceptionInspection | ||
*/ | ||
|
||
namespace Tests\Feature_v2; | ||
|
||
use Tests\Feature_v2\Base\BaseApiV2Test; | ||
|
||
class UsersTest extends BaseApiV2Test | ||
{ | ||
public function testGetGuest(): void | ||
{ | ||
$response = $this->getJson('Users'); | ||
$this->assertUnauthorized($response); | ||
} | ||
|
||
public function testGet(): void | ||
{ | ||
$response = $this->actingAs($this->userMayUpload1)->getJson('Users'); | ||
$this->assertOk($response); | ||
} | ||
|
||
public function testGetCountGuest(): void | ||
{ | ||
$response = $this->getJson('Users::count'); | ||
$this->assertUnauthorized($response); | ||
} | ||
|
||
public function testGetCount(): void | ||
{ | ||
$response = $this->actingAs($this->userMayUpload1)->getJson('Users::count'); | ||
$this->assertOk($response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/** | ||
* We don't care for unhandled exceptions in tests. | ||
* It is the nature of a test to throw an exception. | ||
* Without this suppression we had 100+ Linter warning in this file which | ||
* don't help anything. | ||
* | ||
* @noinspection PhpDocMissingThrowsInspection | ||
* @noinspection PhpUnhandledExceptionInspection | ||
*/ | ||
|
||
namespace Tests\Feature_v2; | ||
|
||
use Tests\Feature_v2\Base\BaseApiV2Test; | ||
|
||
class VersionTest extends BaseApiV2Test | ||
{ | ||
public function testGet(): void | ||
{ | ||
$response = $this->getJson('Version'); | ||
$this->assertOk($response); | ||
} | ||
} |