-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c283920
commit b603713
Showing
38 changed files
with
1,155 additions
and
108 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,44 @@ | ||
<?php | ||
/* | ||
* This file is part of the Calculation package. | ||
* | ||
* (c) bibi.nu <bibi@bibi.nu> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Tests\Controller; | ||
|
||
use App\Controller\AbstractController; | ||
use App\Controller\AjaxController; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
#[CoversClass(AbstractController::class)] | ||
#[CoversClass(AjaxController::class)] | ||
class AjaxControllerTest extends AbstractControllerTestCase | ||
{ | ||
public static function getRoutes(): \Iterator | ||
{ | ||
yield ['/ajax/task', self::ROLE_USER, Response::HTTP_OK, Request::METHOD_POST, true]; | ||
yield ['/ajax/task', self::ROLE_ADMIN, Response::HTTP_OK, Request::METHOD_POST, true]; | ||
yield ['/ajax/task', self::ROLE_SUPER_ADMIN, Response::HTTP_OK, Request::METHOD_POST, true]; | ||
|
||
$query = '/ajax/license?file=vendor/laurentmuller/fpdf2/LICENSE'; | ||
yield [$query, self::ROLE_USER, Response::HTTP_FORBIDDEN, Request::METHOD_GET, true]; | ||
yield [$query, self::ROLE_ADMIN, Response::HTTP_OK, Request::METHOD_GET, true]; | ||
yield [$query, self::ROLE_SUPER_ADMIN, Response::HTTP_OK, Request::METHOD_GET, true]; | ||
|
||
yield ['/ajax/random/text', self::ROLE_USER]; | ||
yield ['/ajax/random/text', self::ROLE_ADMIN]; | ||
yield ['/ajax/random/text', self::ROLE_SUPER_ADMIN]; | ||
|
||
yield ['/ajax/dialog/page', self::ROLE_USER]; | ||
yield ['/ajax/dialog/page', self::ROLE_ADMIN]; | ||
yield ['/ajax/dialog/page', self::ROLE_SUPER_ADMIN]; | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.