Example #1
0
    /**
     * @dataProvider move_data
     */
    public function test_move($group_id, $increment, $excepted_moved, $expected)
    {
        global $cache, $phpbb_root_path, $phpEx;
        $cache = new phpbb_mock_cache();
        $db = $this->new_dbal();
        $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
        $lang = new \phpbb\language\language($lang_loader);
        $user = new \phpbb\user($lang, '\\phpbb\\datetime');
        $user->lang = array();
        $test_class = new \phpbb\groupposition\legend($db, $user);
        $this->assertEquals($excepted_moved, $test_class->move($group_id, $increment));
        $result = $db->sql_query('SELECT group_id, group_legend
			FROM ' . GROUPS_TABLE . '
			ORDER BY group_id ASC');
        $this->assertEquals($expected, $db->sql_fetchrowset($result));
    }