View | Details | Raw Unified | Return to bug 27824
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Reports.t (-2 / +5 lines)
Lines 49-55 $retrieved_report_1->delete; Link Here
49
is( Koha::Reports->search->count, $nb_of_reports + 1, 'Delete should have deleted the report' );
49
is( Koha::Reports->search->count, $nb_of_reports + 1, 'Delete should have deleted the report' );
50
50
51
subtest 'prep_report' => sub {
51
subtest 'prep_report' => sub {
52
    plan tests => 3;
52
    plan tests => 4;
53
53
54
    my $report = Koha::Report->new({
54
    my $report = Koha::Report->new({
55
        report_name => 'report_name_for_test_1',
55
        report_name => 'report_name_for_test_1',
Lines 68-73 subtest 'prep_report' => sub { Link Here
68
    ($sql, undef) = $report->prep_report( [],["1\n12\n\r243",'the other',"42\n32\n22\n12"] );
68
    ($sql, undef) = $report->prep_report( [],["1\n12\n\r243",'the other',"42\n32\n22\n12"] );
69
    is( $sql, qq{SELECT * FROM items WHERE itemnumber IN ('1','12','243') AND 'the other' AND ('42','32','22','12') /* saved_sql.id: $id */},'Expected sql generated correctly with multiple params and no names');
69
    is( $sql, qq{SELECT * FROM items WHERE itemnumber IN ('1','12','243') AND 'the other' AND ('42','32','22','12') /* saved_sql.id: $id */},'Expected sql generated correctly with multiple params and no names');
70
70
71
    $report->savedsql(q{SELECT  i.itemnumber, i.itemnumber as Exemplarnummber, [[i.itemnumber| itemnumber for batch]] FROM items})->store;
72
    my $headers;
73
    ( $sql, $headers ) = $report->prep_report( [], [] );
74
    is_deeply( $headers, { 'itemnumber for batch' => 'itemnumber' } );
71
};
75
};
72
76
73
$schema->storage->txn_rollback;
77
$schema->storage->txn_rollback;
74
- 

Return to bug 27824