Skip to content
Snippets Groups Projects
Commit 34eb47b5 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2093497 by dawehner: Convert ExceptionControllerTest to a phpunit test.

parent e09eb5ea
No related branches found
No related tags found
No related merge requests found
<?php
/**
* Definition of Drupal\system\Tests\System\ExceptionControllerTest.
* @file
* Contains \Drupal\Tests\Core\Controller\ExceptionControllerTest
*/
namespace Drupal\system\Tests\System;
use \Drupal\Core\ContentNegotiation;
use \Drupal\Core\Controller\ExceptionController;
use \Drupal\simpletest\UnitTestBase;
use \Symfony\Component\HttpFoundation\Request;
use \Symfony\Component\HttpKernel\Exception\FlattenException;
use Drupal\Core\ContentNegotiation;
use Drupal\Core\Controller\ExceptionController;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\FlattenException;
/**
* Tests exception controller.
*
* @see \Drupal\Core\Controller\ExceptionController
*
* @group Drupal
*/
class ExceptionControllerTest extends UnitTestBase {
class ExceptionControllerTest extends UnitTestCase {
public static function getInfo() {
return array(
......@@ -33,7 +38,8 @@ public function test405HTML() {
$flat_exception = FlattenException::create($exception, 405);
$exception_controller = new ExceptionController(new ContentNegotiation());
$response = $exception_controller->execute($flat_exception, new Request());
$this->assertEqual($response->getStatusCode(), 405, 'HTTP status of response is correct.');
$this->assertEqual($response->getContent(), 'Method Not Allowed', 'HTTP response body is correct.');
$this->assertEquals($response->getStatusCode(), 405, 'HTTP status of response is correct.');
$this->assertEquals($response->getContent(), 'Method Not Allowed', 'HTTP response body is correct.');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment