public function testJsonEncode__JSON形式にエンコードされた文字列が返る() { $input = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); $this->expected = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; $this->actual = SC_Utils::jsonEncode($input); $this->verify(); }
/** * Page のAction. * * @return void */ public function action() { //決済処理中ステータスのロールバック $objPurchase = new SC_Helper_Purchase_Ex(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $objCustomer = new SC_Customer_Ex(); $customer_id = $objCustomer->getValue('customer_id'); //ページ送り用 $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX, 'pageno=#page#', SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE); $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row); switch ($this->getMode()) { case 'getList': echo SC_Utils_Ex::jsonEncode($this->arrOrder); SC_Response_Ex::actionExit(); break; default: break; } // 支払い方法の取得 $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; $this->json_payment = SC_Utils::jsonEncode($this->arrPayment); $this->json_customer_order_status = SC_Utils::jsonEncode($this->arrCustomerOrderStatus); }