2019-03-28 16:31:03 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Functional;
|
|
|
|
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
2020-04-02 21:13:35 +02:00
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
2019-03-28 16:31:03 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @author kevinfrantz
|
|
|
|
*/
|
|
|
|
class FrameFunctionTest extends WebTestCase
|
|
|
|
{
|
|
|
|
public function testHomepageWithFrame(): void
|
|
|
|
{
|
|
|
|
$client = static::createClient();
|
|
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.html?frame=1');
|
|
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
|
|
$this->assertContains('<html', $client->getResponse()->getContent());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testHomepageFrameWithoutParameter(): void
|
|
|
|
{
|
|
|
|
$client = static::createClient();
|
|
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.html');
|
|
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
|
|
$content = $client->getResponse()->getContent();
|
|
|
|
$this->assertContains('<html', $content);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testHomepageFrameless(): void
|
|
|
|
{
|
|
|
|
$client = static::createClient();
|
|
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.html?frame=0');
|
|
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
|
|
$content = $client->getResponse()->getContent();
|
|
|
|
$this->assertNotContains('<html', $content);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testIncorrectParameterValue(): void
|
|
|
|
{
|
|
|
|
$client = static::createClient();
|
|
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.html?frame=true');
|
2019-03-28 22:17:59 +01:00
|
|
|
$this->assertEquals(500, $client->getResponse()->getStatusCode());
|
2019-03-28 16:31:03 +01:00
|
|
|
}
|
|
|
|
}
|