Lines 21-51
use Test::More;
Link Here
|
21 |
use Test::MockModule; |
21 |
use Test::MockModule; |
22 |
use Test::Warn; |
22 |
use Test::Warn; |
23 |
|
23 |
|
24 |
use Module::Load::Conditional qw/check_install/; |
|
|
25 |
|
26 |
BEGIN { |
27 |
if ( check_install( module => 'Test::DBIx::Class' ) ) { |
28 |
plan tests => 47; |
29 |
} else { |
30 |
plan skip_all => "Need Test::DBIx::Class" |
31 |
} |
32 |
} |
33 |
|
34 |
use_ok('C4::Biblio'); |
24 |
use_ok('C4::Biblio'); |
35 |
|
25 |
|
36 |
#use Test::DBIx::Class {}, 'Biblio'; |
|
|
37 |
use Test::DBIx::Class; #No difference between these two invocations in time taken to execute tests. |
38 |
|
39 |
sub fixtures { |
40 |
my ( $data ) = @_; |
41 |
fixtures_ok [ |
42 |
Biblio => [ |
43 |
[ qw/ biblionumber datecreated timestamp / ], |
44 |
@$data, |
45 |
], |
46 |
], 'add fixtures'; |
47 |
} |
48 |
|
49 |
my $db = Test::MockModule->new('Koha::Database'); |
26 |
my $db = Test::MockModule->new('Koha::Database'); |
50 |
$db->mock( _new_schema => sub { return Schema(); } ); |
27 |
$db->mock( _new_schema => sub { return Schema(); } ); |
51 |
|
28 |
|