Bug 25513: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Tomas Cohen Arazi 2020-05-27 09:55:16 -03:00 committed by Jonathan Druart
parent f1cc9d6b59
commit 9d8f9f1d3b
1 changed files with 18 additions and 1 deletions

View File

@ -108,7 +108,7 @@ subtest 'list() tests' => sub {
subtest 'get() tests' => sub {
plan tests => 6;
plan tests => 8;
$schema->storage->txn_begin;
@ -137,6 +137,23 @@ subtest 'get() tests' => sub {
->status_is(404)
->json_is( '/error' => 'Order not found' );
# Regression tests for bug 25513
# Pick a high value that could be transformed into exponential
# representation and not considered a number by buggy DBD::mysql versions
$order = $builder->build_object(
{
class => 'Koha::Acquisition::Orders',
value => {
orderstatus => 'new',
ecost_tax_excluded => 9963405519357589504,
unitprice => 10177559957753600000
}
}
);
$t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders/" . $order->ordernumber )
->json_is( '' => $order->to_api, 'Number representation should be consistent' );
$schema->storage->txn_rollback;
};