You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
723 B
37 lines
723 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Tests\api\Controller;
|
|
|
|
use App\Tests\ApiTester;
|
|
use Codeception\Example;
|
|
use Iterator;
|
|
|
|
class PageControllerCest
|
|
{
|
|
/** @var ApiTester */
|
|
private $tester;
|
|
|
|
public function _before(ApiTester $tester): void
|
|
{
|
|
$this->tester = $tester;
|
|
}
|
|
|
|
/**
|
|
* @dataProvider dataTestBaseAvailability
|
|
*/
|
|
public function testBaseAvailability(Example $example): void
|
|
{
|
|
$this->tester->sendGet($example['url']);
|
|
$this->tester->seeResponseCodeIs(400);
|
|
$this->tester->seeResponseIsJson();
|
|
}
|
|
|
|
protected static function dataTestBaseAvailability(): Iterator
|
|
{
|
|
yield [
|
|
'url' => '/',
|
|
];
|
|
}
|
|
}
|