mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Optimized MVC and implemented function tests for format
This commit is contained in:
46
application/symfony/tests/Functional/FormatFunctionTest.php
Normal file
46
application/symfony/tests/Functional/FormatFunctionTest.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user