Hello,
If you're developing for HikaShop 3.x ; please use the new cart function instead.
public function addProduct($cart_id, $products, $options = array())
Where $products is an array of "products".
$products = array(
array('id' => $product_id, 'qty' => $product_quantity),
);
But you can simply put the product_id and the function will convert it into the internal format with the default 1 quantity.
Afterwards, depending the context of usage ; you might need to call some functions in order to clean the Checkout cache system. But we would need a lot of details about how you processing your tests (HikaShop configuration, etc).
Regards,