public function testFindAllPayment() { $PaymentName = "forFindPayment"; $PaymentName2 = "forFindPayment2"; $payment = getPaymentInstance($PaymentName); $Payment2 = getPaymentInstance($PaymentName2); $Payments = array(); array_push($Payments, $payment, $Payment2); $bmapper = new PaymentMapper(self::$pdo); $bmapper->insert($Payments); $newPayments = $bmapper->findAll()->fetchAll(); $this->assertEquals(2, count($newPayments)); }
public function hookActionPaymentCCAdd($params) { $PaymentMapper = new PaymentMapper(); $PaymentMapper->processLocalUpdate($params, true, false); }
public function testfindLOCAByUserID() { $pmapper = new PaymentMapper(self::$pdo); $dmapper = new DepositMapper(self::$pdo); $dbfacade = DBFacade::I(self::$pdo); $payment = getPaymentInstance(); $deposit = getDepositInstance(); $pmapper->insert($payment); $dmapper->insert($deposit); $result = $dbfacade->findLOCALogByUserID(1); // instanceは二つともuser_id=1になっているため $this->assertEquals(2, count($result)); }
// Inventory POST $app->post('/inventory/query', function ($request, $response, $args) { $data = $request->getParsedBody(); $this->logger->info("Inventory POST query"); $date = filter_var($data['myInput'], FILTER_SANITIZE_STRING); $mapper = new InventoryQueryMapper($this->db); $inventory = $mapper->processQuery($date); return $this->renderer->render($response, 'queries/query_inventory.phtml', [$args, "inventory" => $inventory]); }); // Invoices $app->get('/invoices/query', function ($request, $response, $args) { $this->logger->info("invoice GET Query Page"); return $this->renderer->render($response, 'queries/query_invoices.phtml'); }); // Invoices POST $app->post('/invoices/query', function ($request, $response, $args) { $data = $request->getParsedBody(); $this->logger->info("invoices POST query"); $name = filter_var($data['customerName'], FILTER_SANITIZE_STRING); $orderId = (int) filter_var($data['orderId'], FILTER_SANITIZE_STRING); $mapper = new InvoicesQueryMapper($this->db); $invoices = $mapper->processQuery($name, $orderId); return $this->renderer->render($response, 'queries/query_invoices.phtml', [$args, "invoices" => $invoices]); }); // Payment $app->get('/payments/query', function ($request, $response, $args) { $this->logger->info("Payments GET Query Page"); $mapper = new PaymentMapper($this->db); $payments = $mapper->processQuery(); return $this->renderer->render($response, 'queries/query_payments.phtml', [$args, "payments" => $payments]); });