<commit_before><?php
/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 2014-10-19
 * Time: 23:46
 */

namespace Conpago\Core;

class WebAppTest extends \PHPUnit_Framework_TestCase
{
    protected $controller;

    protected $logger;

    protected $response;

    protected $appConfig;

    protected $requestDataReader;

    protected $webApp;

    public function testHttp500ErrorOnExceptionFromRequestDataReader()
    {
        $this->response->expects($this->once())->method('setHttpResponseCode')->with(500);
        $this->requestDataReader->expects($this->any())->method('getRequestData')->willThrowException(new \Exception());

        $this->webApp->run();
    }

    public function testSettingTimeZoneWithoutError()
    {
        $this->assertNotEquals('Europe/Warsaw', date_default_timezone_get());
        $this->appConfig->expects($this->any())->method('getTimeZone')->willReturn('Europe/Warsaw');
        $this->webApp->run();
        $this->assertEquals('Europe/Warsaw', date_default_timezone_get());<commit_msg>better test<commit_after><?php
/**
 * Created by PhpStorm.
 * User: <NAME>
 * Date: 2014-10-19
 * Time: 23:46
 */

namespace Conpago\Core;

class WebAppTest extends \PHPUnit_Framework_TestCase
{
    protected $controller;

    protected $logger;

    protected $response;

    protected $appConfig;

    protected $requestDataReader;

    protected $webApp;

    public function testHttp500ErrorOnExceptionFromRequestDataReader()
    {
        $this->response->expects($this->once())->method('setHttpResponseCode')->with(500);
        $this->requestDataReader->expects($this->any())->method('getRequestData')->willThrowException(new \Exception());

        $this->webApp->run();
    }

    public function testSettingTimeZoneWithoutError()
    {
        $this->assertNotEquals('CST6CDT', date_default_timezone_get());
        $this->appConfig->expects($this->any())->method('getTimeZone')->willReturn('Europe/Warsaw');
        $this->webApp->run();
        $this->assertEquals('Europe/Warsaw', date_default_timezone_get());
{'fraction_non_alphanumeric': 0.15628042843232717, 'fraction_numerical': 0.01801363193768257, 'mean_word_length': 4.124688279301745, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '7537527', 'n_tokens_mistral': 643, 'n_tokens_neox': 601, 'n_words': 88}