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

(-)a/C4/SIP/t/10renew_all.t (-17 / +41 lines)
Lines 16-21 my $enable_template = { Link Here
16
    fields => [],
16
    fields => [],
17
};
17
};
18
18
19
# reset_checkin_templates will be used to reset the status of the items if needed
20
# If "make test" is used (all tests at once), after the tests 08 and 09, the item stays checked out and this raises an error here
21
# so we begin with a Checkin, awaiting for the minimal answer : ^10 (Checkin response)
22
# Both results (101 and 100, for OK and NON OK) must be accepted, because if we run this test alone, the item won't necessarily be checked out
23
# and the checkin attempt will then result in a "100" code, which is not a problem (we are just preparing the renewal tests)
24
my @reset_checkin_templates = (
25
    {
26
        id => "Renew All: prep: check in $item_barcode (used in previous tests)",
27
        msg => "09N20060102    08423620060113    084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
28
        pat    => qr/^10/,
29
        fields => [],
30
    },
31
    {
32
        id => "Renew All: prep: check in $item2_barcode (used in previous tests)",
33
        msg => "09N20060102    08423620060113    084235AP$item2_owner|AO$instid|AB$item2_barcode|AC$password|",
34
        pat    => qr/^10/,
35
        fields => [],
36
    }
37
);
38
39
# Checkout as a preparation for renewal
19
my @checkout_templates = (
40
my @checkout_templates = (
20
	{    id => "Renew All: prep: check out $item_barcode to $user_barcode",
41
	{    id => "Renew All: prep: check out $item_barcode to $user_barcode",
21
		msg => "11YN20060329    203000                  AO$instid|AA$user_barcode|AB$item_barcode|AC$password|",
42
		msg => "11YN20060329    203000                  AO$instid|AA$user_barcode|AB$item_barcode|AC$password|",
Lines 27-43 my @checkout_templates = ( Link Here
27
		fields => [],}
48
		fields => [],}
28
);
49
);
29
50
30
my @checkin_templates = (
31
	{    id => "Renew All: prep: check in $item_barcode",
32
		msg => "09N20060102    08423620060113    084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
33
		pat => qr/^101YNN$datepat/,
34
		fields => [],},
35
	{    id => "Renew All: prep: check in $item2_barcode",
36
		msg => "09N20060102    08423620060113    084235AP$item2_owner|AO$instid|AB$item2_barcode|AC$password|",
37
		pat => qr/^101YNN$datepat/,
38
		fields => [],}
39
);
40
41
my $renew_all_test_template = {
51
my $renew_all_test_template = {
42
	 id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password",
52
	 id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password",
43
	msg => "6520060102    084236AO$instid|AA$user_barcode|",
53
	msg => "6520060102    084236AO$instid|AA$user_barcode|",
Lines 52-68 my $renew_all_test_template = { Link Here
52
	]
62
	]
53
};
63
};
54
64
65
# check the book in, when done testing
66
my @checkin_templates = (
67
    {
68
        id => "Renew All: prep: check in $item_barcode",
69
        msg => "09N20060102    08423620060113    084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
70
        pat    => qr/^101YNN$datepat/,
71
        fields => [],
72
    },
73
    {
74
        id => "Renew All: prep: check in $item2_barcode",
75
        msg => "09N20060102    08423620060113    084235AP$item2_owner|AO$instid|AB$item2_barcode|AC$password|",
76
        pat    => qr/^101YNN$datepat/,
77
        fields => [],
78
    }
79
);
80
81
82
55
my @tests = (
83
my @tests = (
56
	     $SIPtest::login_test,
84
	     $SIPtest::login_test,
57
	     $SIPtest::sc_status_test,
85
	     $SIPtest::sc_status_test,
58
#	     $enable_template,
59
	     $checkout_templates[0],
60
	     $renew_all_test_template,
61
	     $checkin_templates[0],	# check the book in, when done testing
62
	     );
86
	     );
63
87
64
my $test;
88
my $test;
65
89
90
# WIP?
66
$test = clone($renew_all_test_template);
91
$test = clone($renew_all_test_template);
67
$test->{id} = 'Renew All: Valid patron, two items checked out';
92
$test->{id} = 'Renew All: Valid patron, two items checked out';
68
$test->{pat} = qr/^66100020000$datepat/;
93
$test->{pat} = qr/^66100020000$datepat/;
Lines 86-92 $test->{fields} = [ Link Here
86
	       $SIPtest::field_specs{(FID_PRINT_LINE)},
111
	       $SIPtest::field_specs{(FID_PRINT_LINE)},
87
		  ];
112
		  ];
88
113
89
push @tests, $checkout_templates[0], $test, $checkin_templates[0];
114
push @tests, $reset_checkin_templates[0], $checkout_templates[0], $test, $checkin_templates[0];
90
115
91
$test = clone($renew_all_test_template);
116
$test = clone($renew_all_test_template);
92
$test->{id} = 'Renew All: invalid patron';
117
$test->{id} = 'Renew All: invalid patron';
93
- 

Return to bug 9848