Bug 17234: Test the column and constraint non-existence
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 2 Jan 2017 10:36:53 +0000 (11:36 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Wed, 11 Jan 2017 10:52:11 +0000 (10:52 +0000)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/Installer.t

index 46d04c0..65875b0 100644 (file)
@@ -22,7 +22,7 @@
 # Add more tests here!!!
 
 use Modern::Perl;
-use Test::More tests => 11;
+use Test::More tests => 13;
 use Koha::Database;
 
 BEGIN {
@@ -55,8 +55,9 @@ my $source = $schema->source('Borrower');
 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 @constraint_names = $source->unique_constraint_names();
 my $constraint_name  = $constraint_names[0];
-ok( constraint_exists( 'borrowers', $constraint_name ),
-    'Known constraint does exist' );
+ok( constraint_exists( 'borrowers', $constraint_name), 'Known contraint does exist' );
+ok( ! constraint_exists( 'borrowers', 'xxx'), 'Constraint xxx does not exist' );