Bug 22472: Add tests
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 7 Mar 2019 12:14:06 +0000 (09:14 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 15 Apr 2019 17:51:02 +0000 (18:51 +0100)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 19b9aacfbae616f7198cd93ebdbd97115d204c5b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/db_dependent/Installer.t

index 0b4cfa2..636af43 100644 (file)
@@ -22,7 +22,7 @@
 # Add more tests here!!!
 
 use Modern::Perl;
-use Test::More tests => 15;
+use Test::More tests => 16;
 use Koha::Database;
 
 BEGIN {
@@ -56,7 +56,11 @@ my @column_names = $source->columns();
 my $column_name  = $column_names[0];
 ok( column_exists( 'borrowers', $column_name ), 'Known column does exist' );
 ok( ! column_exists( 'borrowers', 'xxx'), 'Column xxx does not exist' );
-
+{
+    my $dbh = C4::Context->dbh;
+    $dbh->{RaiseError} = 1;
+    ok( ! column_exists( 'this_table_will_never_exist', 'xxx'), 'Column xxx does not exist, the table does not exist' );
+}
 my @constraint_names = $source->unique_constraint_names();
 my $constraint_name  = $constraint_names[0];
 ok( index_exists( 'borrowers', $constraint_name), 'Known contraint does exist' );