<commit_before><commit_msg>Unit-test for getErrorResponse<commit_after><?php
/**
 * @copyright Copyright (c) 2014 Rocket Internet GmbH, Johannisstra?e 20, 10117 Berlin, http://www.rocket-internet.de
 * @created 2015-03-15
 */
namespace lib\application\controllers\FrontControllerA;
use vsc\application\controllers\FrontControllerA;
use vsc\Exception;
use vsc\presentation\responses\HttpResponse;
use vsc\presentation\responses\HttpResponseType;
use vsc\presentation\views\PlainTextView;
use vsc\presentation\views\ViewA;
use fixtures\presentation\views\NullView;

/**
 * Class getErrorResponseTest
 * @package lib\application\controllers\FrontControllerA
 * @covers \vsc\application\controllers\FrontControllerA::getErrorResponse()
 */
class getErrorResponseTest extends \PHPUnit_Framework_TestCase
{

	public function testBasicGetErrorResponse() {
		$o = new FrontControllerA_underTest_getErrorResponse();

		$errorMessage = uniqid('test:');
		$e = new Exception($errorMessage);

		$response = $o->getErrorResponse($e);
		$this->assertEquals(HttpResponseType::INTERNAL_ERROR, $response->getStatus());
		$this->assertNotFalse(strstr($response->getOutput(), $errorMessage) );
	}
}

class FrontControllerA_underTest_getErrorResponse extends FrontControllerA
{
	/**
	 * @returns ViewA
	 */
	public function getDefaultView()
	{
		return new PlainTextView();
	}
}
{'fraction_non_alphanumeric': 0.12002945508100148, 'fraction_numerical': 0.013991163475699559, 'mean_word_length': 6.467032967032967, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2407175', 'n_tokens_mistral': 438, 'n_tokens_neox': 401, 'n_words': 72}