for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Backend\Modules\ContentBlocks\Tests\Action;
use Common\WebTestCase;
class AddTest extends WebTestCase
{
public function testAuthenticationIsNeeded(): void
$client = static::createClient();
$this->logout($client);
$client->setMaxRedirects(1);
$client->request('GET', '/private/en/content_blocks/index');
// we should get redirected to authentication with a reference to blog index in our url
self::assertStringEndsWith(
'/private/en/authentication?querystring=%2Fprivate%2Fen%2Fcontent_blocks%2Findex',
$client->getHistory()->current()->getUri()
);
}
public function testFormIsDisplayed(): void
$this->login($client);
$client->request('GET', '/private/en/content_blocks/add');
self::assertContains(
'Title<abbr data-toggle="tooltip" aria-label="Required field" title="Required field">*</abbr>',
$client->getResponse()->getContent()
'Visible on site',
'Add content block',