Bug 20592: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 24 Apr 2018 18:53:02 +0000 (15:53 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Nov 2018 09:09:06 +0000 (10:09 +0100)
NOTE: It isn't really a test, but it does trigger
      the return line which was added to ModItem.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 619eca1c7aaebf4db6ed170a3cbd14065da79c9d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 02860425d9ed9229664dc1d977f1d45ce83bcb50)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

t/db_dependent/Items.t

index bc7500a..52c179a 100755 (executable)
@@ -65,6 +65,12 @@ subtest 'General Add, Get and Del tests' => sub {
     is( $getitem->{location}, $location, "The location should not have been modified" );
     is( $getitem->{permanent_location}, $location, "The permanent_location should have been set to the location value" );
 
+
+    # Do not modify anything, and do not explode!
+    my $dbh = C4::Context->dbh;
+    local $dbh->{RaiseError} = 1;
+    ModItem({}, $bibnum, $itemnumber);
+
     # Modify item; setting barcode.
     ModItem({ barcode => '987654321' }, $bibnum, $itemnumber);
     my $moditem = GetItem($itemnumber);