use Modern::Perl;
-use Test::More tests => 12;
+use Test::More tests => 13;
use Test::Warn;
use C4::Context;
my @borrowers = Koha::Borrowers->search( { branchcode => $branchcode } );
is( @borrowers, 3, "Found 3 borrowers with Search" );
+my $unexistent = Koha::Borrowers->find( '1234567890' );
+is( $unexistent, undef, 'Koha::Objects->Find should return undef if the record does not exist' );
+
my $borrowers = Koha::Borrowers->search( { branchcode => $branchcode } );
is( $borrowers->count( { branchcode => $branchcode } ), 3, "Counted 3 borrowers with Count" );
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
-use Test::More tests => 4;
+use Test::More tests => 5;
use C4::Context;
# Start transaction
my $newopacheader = "newopacheader";
C4::Context->set_preference( 'OPACHEADER', $newopacheader );
-is( C4::Context->preference('opacheader'), $newopacheader );
+is( C4::Context->preference('opacheader'), $newopacheader, 'The pref should have been set correctly' );
C4::Context->set_preference( 'opacheader', $opacheader );
-is( C4::Context->preference('OPACHEADER'), $opacheader );
+is( C4::Context->preference('OPACHEADER'), $opacheader, 'A pref name should be case insensitive');
$ENV{OVERRIDE_SYSPREF_opacheader} = 'this is an override';
C4::Context->clear_syspref_cache();
'system preference value overridden from environment'
);
+is( C4::Context->preference('IDoNotExist'), undef, 'Get a non-existent system preference should return undef');
+
C4::Context->set_preference( 'IDoNotExist', 'NonExistent' );
-is( C4::Context->preference('IDoNotExist'), 'NonExistent', 'Test creation of non-existant system preferencer' );
+is( C4::Context->preference('IDoNotExist'), 'NonExistent', 'Test creation of non-existent system preference' );