Lines 17-32
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 11; |
20 |
use Test::More; |
21 |
use Test::Warn; |
21 |
use Test::Warn; |
22 |
use t::lib::Mocks; |
22 |
use t::lib::Mocks; |
23 |
|
23 |
|
|
|
24 |
use Module::Load::Conditional qw/check_install/; |
25 |
|
24 |
BEGIN { |
26 |
BEGIN { |
25 |
use Test::DBIx::Class; |
27 |
if ( check_install( module => 'Test::DBIx::Class' ) ) { |
|
|
28 |
plan tests => 11; |
29 |
} else { |
30 |
plan skip_all => "Need Test::DBIx::Class" |
31 |
} |
26 |
use_ok('Koha::Object'); |
32 |
use_ok('Koha::Object'); |
27 |
use_ok('Koha::Patron'); |
33 |
use_ok('Koha::Patron'); |
28 |
} |
34 |
} |
29 |
|
35 |
|
|
|
36 |
use Test::DBIx::Class; |
37 |
|
30 |
my $object = Koha::Patron->new( { surname => 'Test Patron' } ); |
38 |
my $object = Koha::Patron->new( { surname => 'Test Patron' } ); |
31 |
is( $object->surname(), 'Test Patron', "Accessor returns correct value" ); |
39 |
is( $object->surname(), 'Test Patron', "Accessor returns correct value" ); |
32 |
$object->surname('Test Patron Surname'); |
40 |
$object->surname('Test Patron Surname'); |