<commit_before><?php

class CM_Log_ContextTest extends CMTest_TestCase {

    public function tearDown() {
        CMTest_TH::clearEnv();
    }

    public function testGetHttpRequest() {
        /** @var CM_Http_Request_Abstract $request */
        $request = $this->mockClass('CM_Http_Request_Abstract')->newInstanceWithoutConstructor();
        $context = new CM_Log_Context();
        $context->setHttpRequest($request);
        $this->assertSame($request, $context->getHttpRequest());
    }

    public function testSetExtra() {
        $extra = ['foo' => 'bar', 'baz' => ['quux' => 1, 'foo' => 0]];
        $context = new CM_Log_Context();
        $context->setExtra($extra);
        $this->assertSame($extra, $context->getExtra());

        $exception = $this->catchException(function () use ($context) {
            $context->setExtra(['foo' => 'bar', 'fooBar' => ['1' => ['2' => new stdClass()]]]);
        });
        $this->assertInstanceOf('CM_Exception_Invalid', $exception);
        $this->assertSame('Object can not be passed to "Extra"', $exception->getMessage());
    }
}<commit_msg>Remove CM_Log_ContextTest::testSetExtra<commit_after><?php

class CM_Log_ContextTest extends CMTest_TestCase {

    public function tearDown() {
        CMTest_TH::clearEnv();
    }

    public function testGetHttpRequest() {
        /** @var CM_Http_Request_Abstract $request */
        $request = $this->mockClass('CM_Http_Request_Abstract')->newInstanceWithoutConstructor();
        $context = new CM_Log_Context();
        $context->setHttpRequest($request);
        $this->assertSame($request, $context->getHttpRequest());
    }
}
{'fraction_non_alphanumeric': 0.1614678899082569, 'fraction_numerical': 0.0024464831804281344, 'mean_word_length': 3.5193370165745854, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '2539927', 'n_tokens_mistral': 473, 'n_tokens_neox': 464, 'n_words': 85}