Lines 24-30
use Test::More tests => 3;
Link Here
|
24 |
use t::lib::TestBuilder; |
24 |
use t::lib::TestBuilder; |
25 |
|
25 |
|
26 |
use Koha::Database; |
26 |
use Koha::Database; |
27 |
use C4::SocialData qw( get_data get_report ); |
27 |
use C4::SocialData; |
28 |
|
28 |
|
29 |
my $schema = Koha::Database->new->schema; |
29 |
my $schema = Koha::Database->new->schema; |
30 |
my $builder = t::lib::TestBuilder->new; |
30 |
my $builder = t::lib::TestBuilder->new; |
Lines 59-65
subtest 'get_report' => sub {
Link Here
|
59 |
is( $report->{'without'}->[0]->{'isbn'}, '9780596526740', 'testing get_report' ); |
59 |
is( $report->{'without'}->[0]->{'isbn'}, '9780596526740', 'testing get_report' ); |
60 |
|
60 |
|
61 |
# test if we can get with key instead |
61 |
# test if we can get with key instead |
62 |
$schema->resultset('SocialData')->search( { isbn => '0-596-52674-1' } ) |
62 |
$schema->resultset('SocialData') |
|
|
63 |
->search( { isbn => '0-596-52674-1' } ) |
63 |
->next->update( { isbn => '9780596526740' } ); |
64 |
->next->update( { isbn => '9780596526740' } ); |
64 |
$report = C4::SocialData::get_report(); |
65 |
$report = C4::SocialData::get_report(); |
65 |
is( $report->{with}->[0]->{isbn}, '9780596526740', 'this isbn has social data' ); |
66 |
is( $report->{with}->[0]->{isbn}, '9780596526740', 'this isbn has social data' ); |