diff --git a/t/db_dependent/Patroncards.t b/t/db_dependent/Patroncards.t index 5ae61af1dc..375b20b787 100755 --- a/t/db_dependent/Patroncards.t +++ b/t/db_dependent/Patroncards.t @@ -15,20 +15,27 @@ # with Koha; if not, see . use Modern::Perl; + use Test::More tests => 1; -use Test::MockModule; -use t::lib::Mocks; -use t::lib::TestBuilder; -use C4::Patroncards::Layout qw( save new ); +use C4::Patroncards::Layout; +use Koha::Database; + +my $schema = Koha::Database->new->schema; + +subtest 'save() tests' => sub { -subtest '->save' => sub { plan tests => 1; + + $schema->storage->txn_begin; + my $layout = C4::Patroncards::Layout->new( layout_name => "new patron card", - layout_id => '', # The interface send an empty string + layout_id => '', # The interface send an empty string layout_xml => 'some_xml' ); my $layout_id = $layout->save; - ok($layout_id > 0, 'A layout_id should have been returned on ->save'); + ok( $layout_id > 0, 'A layout_id should have been returned on ->save' ); + + $schema->storage->txn_rollback; };