<commit_before><?php

class DiagnosticsTest extends PHPUnit_Framework_TestCase {
    protected $config;

    protected function setUp(){
        $this->config = new Bugsnag_Configuration();
        $this->diagnostics = new Bugsnag_Diagnostics($this->config);
    }

    public function testDefaultAppData() {
        $this->config->releaseStage = 'qa1';
        $this->config->appVersion = '1.2.3';
        $this->config->type = "laravel";

        $this->assertEquals($this->diagnostics->getAppData()['releaseStage'], 'qa1');
        $this->assertEquals($this->diagnostics->getAppData()['version'], '1.2.3');
        $this->assertEquals($this->diagnostics->getAppData()['type'], 'laravel');
    }

    public function testDefaultDeviceData() {
        $this->config->hostname = 'web1.example.com';
        $this->assertEquals($this->diagnostics->getDeviceData()['hostname'], 'web1.example.com');
    }

    public function testDefaultContext() {
        $this->config->context = 'herp#derp';
        $this->assertEquals($this->diagnostics->getContext(), 'herp#derp');
    }

    public function testDefaultUser() {
        $this->config->user = array('id' => 123, 'email' => "<EMAIL>", 'name' => "<NAME>");
        $this->assertEquals($this->diagnostics->getUser()['id'], 123);
        $this->assertEquals($this->diagnostics->getUser()['email'], "<EMAIL>");
        $this->assertEquals($this->diagnostics->getUser()['name'], "<NAME>");
    }
}<commit_msg>Attempt to fix tests on php5.2 and 5.3<commit_after><?php

class DiagnosticsTest extends PHPUnit_Framework_TestCase {
    protected $config;

    protected function setUp(){
        $this->config = new Bugsnag_Configuration();
        $this->diagnostics = new Bugsnag_Diagnostics($this->config);
    }

    public function testDefaultAppData() {
        $this->config->releaseStage = 'qa1';
        $this->config->appVersion = '1.2.3';
        $this->config->type = "laravel";

        $appData = $this->diagnostics->getAppData();

        $this->assertEquals($appData['releaseStage'], 'qa1');
        $this->assertEquals($appData['version'], '1.2.3');
        $this->assertEquals($appData['type'], 'laravel');
    }

    public function testDefaultDeviceData() {
        $this->config->hostname = 'web1.example.com';

        $deviceData = $this->diagnostics->getDeviceData();

        $this->assertEquals($deviceData['hostname'], 'web1.example.com');
    }

    public function testDefaultContext() {
        $this->config->context = 'herp#derp';
        $this->assertEquals($this->diagnostics->getContext(), 'herp#derp');
    }

    public function testDefaultUser() {
        $this->config->user = array('id' => 123, 'email' => "<EMAIL>", 'name' => "<NAME>");

        $userData = $this->diagnostics->getUser();

        $this->assertEquals($userData['id'], 123);
        $this->assertEquals($userData['email'], "<EMAIL>");
        $this->assertEquals($userData['name'], "<NAME>");
    }
}
{'fraction_non_alphanumeric': 0.19328585961342828, 'fraction_numerical': 0.012207527975584944, 'mean_word_length': 3.4969512195121952, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 87, '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': '6592967', 'n_tokens_mistral': 884, 'n_tokens_neox': 860, 'n_words': 135}