public function compareResponseRequest() { $requestOrders = $this->request->getOrders(); $responseOrders = $this->response->getGroup("Orders"); $responseOrders = $responseOrders["Order"]; /** * Format the array */ if (array_key_exists("IdOrder", $responseOrders)) { $responseOrders = [$responseOrders]; } foreach ($responseOrders as &$responseOrder) { $status = $responseOrder["StatusUpdated"]; unset($responseOrder["StatusUpdated"]); $responseOrder["Status"] = $status === "True" ? "Sent" : "Canceled"; } return $requestOrders == $responseOrders; }
public function testRequestGetOrders() { $this->request->addOrder(["IdOrder" => "12345", "Marketplace" => "Amazon", "Status" => "Canceled"]); $this->assertEquals([["IdOrder" => "12345", "Marketplace" => "Amazon", "Status" => "Canceled"]], $this->request->getOrders()); }