<commit_before><?php

/**
 * tests for the Hm_Server_List trait
 */
class Hm_Test_Server_List extends PHPUnit_Framework_TestCase {

    public function setUp() {
        require 'bootstrap.php';
        Hm_Server_Wrapper::add(array('user' => 'testuser', 'pass' => '<PASSWORD>', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1));
        Hm_Server_Wrapper::add(array('user' => 'testuser', 'pass' => '<PASSWORD>', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), 3);
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_add() {
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(0));
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(3));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_toggle_hidden() {
        Hm_Server_Wrapper::toggle_hidden(0, 1);
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false, 'hide' => 1), Hm_Server_Wrapper::dump(0));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_dump() {
        $this->assertEquals(array( 0 => array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), 3 => array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false)), Hm_Server_Wrapper::dump());
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(0));
        $this->assertEquals(array('pass' => '<PASSWORD>', 'user' => 'testuser', 'object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
        $this->assertEquals(array(), Hm_Server_Wrapper::dump(1));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_forget_credentials() {
        $this->assertEquals(array('pass' => '<PASSWORD>', 'user' => 'testuser', 'object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
        Hm_Server_Wrapper::forget_credentials(0);
        $this->assertEquals(array('object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
    }<commit_msg>unit test update<commit_after><?php

/**
 * tests for the Hm_Server_List trait
 */
class Hm_Test_Server_List extends PHPUnit_Framework_TestCase {

    public function setUp() {
        require 'bootstrap.php';
        Hm_Server_Wrapper::add(array('user' => 'testuser', 'pass' => '<PASSWORD>', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1));
        Hm_Server_Wrapper::add(array('user' => 'testuser', 'pass' => '<PASSWORD>', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), 3);
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_add() {
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(0));
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(3));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_toggle_hidden() {
        Hm_Server_Wrapper::toggle_hidden(0, 1);
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false, 'hide' => 1), Hm_Server_Wrapper::dump(0));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_dump() {
        $this->assertEquals(array( 0 => array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), 3 => array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false)), Hm_Server_Wrapper::dump());
        $this->assertEquals(array('user' => 'testuser', 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'object' => false, 'connected' => false), Hm_Server_Wrapper::dump(0));
        $this->assertEquals(array('pass' => '<PASSWORD>', 'user' => 'testuser', 'object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
        $this->assertEquals(array(), Hm_Server_Wrapper::dump(1));
        Hm_Server_Wrapper::add(array('user' => 'testuser', 'name=' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1, 'pass' => false), 20);
        $this->assertTrue(array_key_exists('nopass', Hm_Server_Wrapper::dump(20)));
    }
    /**
     * @preserveGlobalState disabled
     * @runInSeparateProcess
     */
    public function test_forget_credentials() {
        $this->assertEquals(array('pass' => '<PASSWORD>', 'user' => 'testuser', 'object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
        Hm_Server_Wrapper::forget_credentials(0);
        $this->assertEquals(array('object' => false, 'connected' => false, 'name' => 'test', 'server' => 'test', 'port' => 0, 'tls' => 1), Hm_Server_Wrapper::dump(0, true));
    }
{'fraction_non_alphanumeric': 0.23460458973088988, 'fraction_numerical': 0.013207858675912168, 'mean_word_length': 4.103622577927548, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 194, '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': '1972875', 'n_tokens_mistral': 2090, 'n_tokens_neox': 2021, 'n_words': 443}