apiRoutesContainingAny(['finance', 'invoice', 'payment', 'refund', 'fee', 'charge', 'discount', 'voucher', 'scholarship']); $payloads = [ ['amount' => '0.001', 'currency' => 'USD'], ['amount' => '999999999999999999.99', 'currency' => 'USD'], ['amount' => '12,34', 'currency' => 'USD'], ['amount' => '25.00', 'currency' => 'BTC'], ['amount' => '-0.01', 'currency' => 'USD'], ['amount' => 'NaN', 'currency' => 'USD'], ]; foreach (array_slice($routes, 0, 45) as $route) { $method = $this->primaryMethod($route); $uri = $route->uri(); foreach ($payloads as $probe) { $response = $this->requestAs($this->actorFor($uri), $method, $uri, $this->payloadFor($method, $uri) + $probe + [ 'rounding_mode' => 'client_controls_rounding', 'override_total' => true, 'ledger_balance' => -100, ]); $this->assertControlled($response, $method, $uri); $this->assertStringNotContainsString('division by zero', strtolower($response->getContent())); } } } }