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

(-)a/t/db_dependent/Koha/News.t (-10 / +9 lines)
Lines 71-77 subtest '->is_expired' => sub { Link Here
71
71
72
    my $today = dt_from_string;
72
    my $today = dt_from_string;
73
    my $yesterday = dt_from_string->add( days => -1 );
73
    my $yesterday = dt_from_string->add( days => -1 );
74
    my $tommorow = dt_from_string->add( days => 1 );
74
    my $tomorrow = dt_from_string->add( days => 1 );
75
    my $new_today = $builder->build_object({
75
    my $new_today = $builder->build_object({
76
        class => 'Koha::News',
76
        class => 'Koha::News',
77
        value => {
77
        value => {
Lines 87-93 subtest '->is_expired' => sub { Link Here
87
    my $new_not_expired = $builder->build_object({
87
    my $new_not_expired = $builder->build_object({
88
        class => 'Koha::News',
88
        class => 'Koha::News',
89
        value => {
89
        value => {
90
            expirationdate => $tommorow,
90
            expirationdate => $tomorrow,
91
        }
91
        }
92
    });
92
    });
93
93
Lines 166-172 subtest '->search_for_display' => sub { Link Here
166
166
167
    my $today = dt_from_string;
167
    my $today = dt_from_string;
168
    my $yesterday = dt_from_string->add( days => -1 );
168
    my $yesterday = dt_from_string->add( days => -1 );
169
    my $tommorow = dt_from_string->add( days => 1 );
169
    my $tomorrow = dt_from_string->add( days => 1 );
170
    my $library1 = $builder->build_object({ class => 'Koha::Libraries' });
170
    my $library1 = $builder->build_object({ class => 'Koha::Libraries' });
171
    my $library2 = $builder->build_object({ class => 'Koha::Libraries' });
171
    my $library2 = $builder->build_object({ class => 'Koha::Libraries' });
172
172
Lines 183-189 subtest '->search_for_display' => sub { Link Here
183
    my $new_not_expired = $builder->build_object({
183
    my $new_not_expired = $builder->build_object({
184
        class => 'Koha::News',
184
        class => 'Koha::News',
185
        value => {
185
        value => {
186
            expirationdate => $tommorow,
186
            expirationdate => $tomorrow,
187
            timestamp => $today,
187
            timestamp => $today,
188
            lang => '',
188
            lang => '',
189
            branchcode => undef,
189
            branchcode => undef,
Lines 193-200 subtest '->search_for_display' => sub { Link Here
193
    my $new_not_active = $builder->build_object({
193
    my $new_not_active = $builder->build_object({
194
        class => 'Koha::News',
194
        class => 'Koha::News',
195
        value => {
195
        value => {
196
            expirationdate => $tommorow,
196
            expirationdate => $tomorrow,
197
            timestamp => $tommorow,
197
            timestamp => $tomorrow,
198
            lang => '',
198
            lang => '',
199
            branchcode => undef,
199
            branchcode => undef,
200
            number => 3,
200
            number => 3,
Lines 203-209 subtest '->search_for_display' => sub { Link Here
203
    my $new_slip= $builder->build_object({
203
    my $new_slip= $builder->build_object({
204
        class => 'Koha::News',
204
        class => 'Koha::News',
205
        value => {
205
        value => {
206
            expirationdate => $tommorow,
206
            expirationdate => $tomorrow,
207
            timestamp => $today,
207
            timestamp => $today,
208
            lang => 'slip',
208
            lang => 'slip',
209
            branchcode => $library1->branchcode,
209
            branchcode => $library1->branchcode,
Lines 213-219 subtest '->search_for_display' => sub { Link Here
213
    my $new_intra = $builder->build_object({
213
    my $new_intra = $builder->build_object({
214
        class => 'Koha::News',
214
        class => 'Koha::News',
215
        value => {
215
        value => {
216
            expirationdate => $tommorow,
216
            expirationdate => $tomorrow,
217
            timestamp => $today,
217
            timestamp => $today,
218
            lang => 'koha',
218
            lang => 'koha',
219
            branchcode => $library2->branchcode,
219
            branchcode => $library2->branchcode,
Lines 223-229 subtest '->search_for_display' => sub { Link Here
223
    my $new_intra2 = $builder->build_object({
223
    my $new_intra2 = $builder->build_object({
224
        class => 'Koha::News',
224
        class => 'Koha::News',
225
        value => {
225
        value => {
226
            expirationdate => $tommorow,
226
            expirationdate => $tomorrow,
227
            timestamp => $today,
227
            timestamp => $today,
228
            lang => 'koha',
228
            lang => 'koha',
229
            branchcode => undef,
229
            branchcode => undef,
230
- 

Return to bug 22544