<commit_before><?php

class CM_Paging_User_OnlineTest extends CMTest_TestCase {

    public function testGetItems() {
        $user1 = CMTest_TH::createUser();
        $user1->setOnline(true);
        $user2 = CMTest_TH::createUser();
        $user2->setOnline(false);
        $this->assertEquals([$user1], (new CM_Paging_User_Online())->getItems());

        $user2->setOnline(true);
        $this->assertEquals([$user1, $user2], (new CM_Paging_User_Online())->getItems());
    }

    public function testContains() {
        $user = CMTest_TH::createUser();
        $this->assertFalse((new CM_Paging_User_Online())->contains($user));

        $user->setOnline(true);
        $this->assertTrue((new CM_Paging_User_Online())->contains($user));

        $user->setOnline(false);
        $this->assertFalse((new CM_Paging_User_Online())->contains($user));
    }
}<commit_msg>Adjust tests<commit_after><?php

class CM_Paging_User_OnlineTest extends CMTest_TestCase {

    public function testGetItems() {
        $user1 = CMTest_TH::createUser();
        $user1->setOnline(true);
        $user2 = CMTest_TH::createUser();
        $user2->setOnline(false);
        $this->assertEquals([$user1], (new CM_Paging_User_Online())->getItems());

        CM_Cache_Local::getInstance()->flush();
        $user2->setOnline(true);
        $this->assertEquals([$user1, $user2], (new CM_Paging_User_Online())->getItems());
    }

    public function testContains() {
        $user = CMTest_TH::createUser();
        $this->assertFalse((new CM_Paging_User_Online())->contains($user));

        CM_Cache_Local::getInstance()->flush();
        $user->setOnline(true);
        $this->assertTrue((new CM_Paging_User_Online())->contains($user));

        CM_Cache_Local::getInstance()->flush();
        $user->setOnline(false);
        $this->assertFalse((new CM_Paging_User_Online())->contains($user));
    }
}
{'fraction_non_alphanumeric': 0.17204870301746955, 'fraction_numerical': 0.008470089994706194, 'mean_word_length': 3.725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 36, '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': '1204889', 'n_tokens_mistral': 610, 'n_tokens_neox': 580, 'n_words': 74}