Cachet/tests/Api/GeneralTest.php
Graham Campbell 19e3804227 Updated tests
2015-12-06 11:04:02 +00:00

45 lines
1.0 KiB
PHP

<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace CachetHQ\Tests\Cachet\Api;
/**
* This is the general test class.
*
* @author James Brooks <james@alt-three.com>
* @author Graham Campbell <graham@alt-three.com>
*/
class GeneralTest extends AbstractApiTestCase
{
public function testGetPing()
{
$this->get('/api/v1/ping');
$this->seeJson(['data' => 'Pong!']);
$this->assertResponseOk();
$this->seeHeader('Content-Type', 'application/json');
}
public function testErrorPage()
{
$this->get('/api/v1/not-found');
$this->assertResponseStatus(404);
$this->seeHeader('Content-Type', 'application/json');
}
public function testNotAcceptableContentType()
{
$this->get('/api/v1/ping', ['HTTP_Accept' => 'text/html']);
$this->assertResponseStatus(406);
}
}