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

(-)a/t/db_dependent/CourseReserves/CourseItems.t (-22 / +4 lines)
Lines 55-61 my $course = $builder->build({ Link Here
55
    source => 'CourseReserve',
55
    source => 'CourseReserve',
56
    value => {
56
    value => {
57
        ci_id => $ci_id,
57
        ci_id => $ci_id,
58
        enabled => 'no',
59
    }
58
    }
60
});
59
});
61
60
Lines 219-225 subtest 'Ensure modifying fields on existing course items updates the item and c Link Here
219
        source => 'CourseReserve',
218
        source => 'CourseReserve',
220
        value => {
219
        value => {
221
            ci_id => $ci_id,
220
            ci_id => $ci_id,
222
            enabled => 'no',
223
        }
221
        }
224
    });
222
    });
225
223
Lines 336-347 subtest 'Ensure modifying fields on existing course items updates the item and c Link Here
336
subtest 'Ensure item info is preserved' => sub {
334
subtest 'Ensure item info is preserved' => sub {
337
    plan tests => 8;
335
    plan tests => 8;
338
336
339
    my $course = $builder->build({
337
    my $course = $builder->build({ source => 'Course' });
340
        source => 'Course',
341
        value => {
342
            enabled => 'no',
343
        }
344
    });
345
    my $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"});
338
    my $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"});
346
    #Add course item but change nothing
339
    #Add course item but change nothing
347
    my $course_item_id = ModCourseItem(
340
    my $course_item_id = ModCourseItem(
Lines 366-377 subtest 'Ensure item info is preserved' => sub { Link Here
366
    is( $item->holdingbranch, $item_after->holdingbranch, "Holdingbranch is unchanged after adding to and removing from course reserves for inactive course");
359
    is( $item->holdingbranch, $item_after->holdingbranch, "Holdingbranch is unchanged after adding to and removing from course reserves for inactive course");
367
    is( $item->ccode, $item_after->ccode, "Collection is unchanged after adding to and removing from course reserves for inactive course");
360
    is( $item->ccode, $item_after->ccode, "Collection is unchanged after adding to and removing from course reserves for inactive course");
368
361
369
    $course = $builder->build({
362
    $course = $builder->build({ source => 'Course' });
370
        source => 'Course',
371
        value => {
372
            enabled => 'yes',
373
        }
374
    });
375
    $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"});
363
    $item = $builder->build_sample_item({ ccode=>"grasshopper", location=>"transylvania"});
376
    #Add course item but change nothing
364
    #Add course item but change nothing
377
    $course_item_id = ModCourseItem(
365
    $course_item_id = ModCourseItem(
Lines 401-412 subtest 'Ensure item info is preserved' => sub { Link Here
401
subtest 'biblio added to course without items' => sub {
389
subtest 'biblio added to course without items' => sub {
402
    plan tests => 1;
390
    plan tests => 1;
403
391
404
    my $course = $builder->build({
392
    my $course = $builder->build({ source => 'Course' });
405
        source => 'Course',
406
        value => {
407
            enabled => 'no',
408
        }
409
    });
410
    #Add course item but change nothing
393
    #Add course item but change nothing
411
    my $course_item_id = ModCourseItem(
394
    my $course_item_id = ModCourseItem(
412
        itemnumber    => undef,
395
        itemnumber    => undef,
Lines 424-430 subtest 'biblio added to course without items' => sub { Link Here
424
        public_note => '',
407
        public_note => '',
425
    );
408
    );
426
409
427
    my $course_item = GetCourseItem({ ci_id => $course_item_id });
410
    my $course_item = GetCourseItem( ci_id => $course_item_id );
428
    is( $course_item->{itemnumber}, undef, "Course reserve with no item correctly added" );
411
    is( $course_item->{itemnumber}, undef, "Course reserve with no item correctly added" );
429
};
412
};
430
413
431
- 

Return to bug 32351