mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 14:27:28 +01:00
47 lines
1.6 KiB
PHP
47 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Tests\Functional;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class FormatFunctionTest extends WebTestCase
|
|
{
|
|
public function testHomepage(): void
|
|
{
|
|
$client = static::createClient();
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE');
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
$this->assertContains('<html', $client->getResponse()->getContent());
|
|
}
|
|
|
|
public function testHomepageWithHTML(): void
|
|
{
|
|
$client = static::createClient();
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.html');
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
$this->assertContains('<html', $client->getResponse()->getContent());
|
|
}
|
|
|
|
public function testHomepageWithJSON(): void
|
|
{
|
|
$client = static::createClient();
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.json');
|
|
echo $client->getResponse()->getContent();
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
// $this->assertContains('<html', $client->getResponse()->getContent());
|
|
}
|
|
|
|
public function testHomepageWithXML(): void
|
|
{
|
|
$client = static::createClient();
|
|
$client->request(Request::METHOD_GET, 'api/rest/source/HOMEPAGE.xml');
|
|
echo $client->getResponse()->getContent();
|
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
|
// $this->assertContains('<html', $client->getResponse()->getContent());
|
|
}
|
|
}
|