Browse Source

Bug 26636: Regression tests for undef case

This patch adds tests for the case in which there's no object identified
by the supplied $id. It should return undef.

Sponsored-by: Virginia Polytechnic Institute and State University

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Tomás Cohen Arazi 3 years ago
committed by Jonathan Druart
parent
commit
653fe39625
  1. 9
      t/db_dependent/Koha/REST/Plugin/Objects.t

9
t/db_dependent/Koha/REST/Plugin/Objects.t

@ -470,7 +470,7 @@ subtest 'object.search helper order by embedded columns' => sub {
subtest 'objects.find helper' => sub {
plan tests => 6;
plan tests => 9;
my $t = Test::Mojo->new;
@ -487,6 +487,13 @@ subtest 'objects.find helper' => sub {
->status_is(200)
->json_is( $city_2->to_api );
# Remove the city
my $city_2_id = $city_2->id;
$city_2->delete;
$t->get_ok( '/cities/' . $city_2_id )
->status_is(200)
->json_is( undef );
$schema->storage->txn_rollback;
};

Loading…
Cancel
Save