public function assertCanCancelOrder(PhortuneCart $cart) { switch ($cart->getStatus()) { case PhortuneCart::STATUS_PURCHASED: throw new Exception(pht('This order can not be cancelled because it has already been ' . 'completed.')); break; } }