Exemplo n.º 1
0
    /**
     * @dataProvider add_group_teampage_data
     */
    public function test_add_group_teampage($group_id, $parent_id, $expected_added, $expected)
    {
        global $cache;
        $cache = new phpbb_mock_cache();
        $db = $this->new_dbal();
        $user = new \phpbb\user('\\phpbb\\datetime');
        $user->lang = array();
        $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
        $this->assertEquals($expected_added, $test_class->add_group_teampage($group_id, $parent_id));
        $result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
			FROM ' . TEAMPAGE_TABLE . '
			ORDER BY teampage_position ASC');
        $this->assertEquals($expected, $db->sql_fetchrowset($result));
    }