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

(-)a/C4/SIP/t/10renew_all.t (-17 / +33 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
	{    id => "Renew All: prep: check in $item_barcode (used in previous tests)",
26
		msg => "09N20060102    08423620060113    084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
27
		pat => qr/^10/,
28
		fields => [],},
29
	{    id => "Renew All: prep: check in $item2_barcode (used in previous tests)",
30
		msg => "09N20060102    08423620060113    084235AP$item2_owner|AO$instid|AB$item2_barcode|AC$password|",
31
		pat => qr/^10/,
32
		fields => [],}
33
);
34
35
# Checkout as a preparation for renewal
19
my @checkout_templates = (
36
my @checkout_templates = (
20
	{    id => "Renew All: prep: check out $item_barcode to $user_barcode",
37
	{    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|",
38
		msg => "11YN20060329    203000                  AO$instid|AA$user_barcode|AB$item_barcode|AC$password|",
Lines 27-43 my @checkout_templates = ( Link Here
27
		fields => [],}
44
		fields => [],}
28
);
45
);
29
46
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 = {
47
my $renew_all_test_template = {
42
	 id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password",
48
	 id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password",
43
	msg => "6520060102    084236AO$instid|AA$user_barcode|",
49
	msg => "6520060102    084236AO$instid|AA$user_barcode|",
Lines 52-68 my $renew_all_test_template = { Link Here
52
	]
58
	]
53
};
59
};
54
60
61
# check the book in, when done testing
62
my @checkin_templates = (
63
	{    id => "Renew All: prep: check in $item_barcode",
64
		msg => "09N20060102    08423620060113    084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
65
		pat => qr/^101YNN$datepat/,
66
		fields => [],},
67
	{    id => "Renew All: prep: check in $item2_barcode",
68
		msg => "09N20060102    08423620060113    084235AP$item2_owner|AO$instid|AB$item2_barcode|AC$password|",
69
		pat => qr/^101YNN$datepat/,
70
		fields => [],}
71
);
72
73
74
55
my @tests = (
75
my @tests = (
56
	     $SIPtest::login_test,
76
	     $SIPtest::login_test,
57
	     $SIPtest::sc_status_test,
77
	     $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
	     );
78
	     );
63
79
64
my $test;
80
my $test;
65
81
82
# WIP?
66
$test = clone($renew_all_test_template);
83
$test = clone($renew_all_test_template);
67
$test->{id} = 'Renew All: Valid patron, two items checked out';
84
$test->{id} = 'Renew All: Valid patron, two items checked out';
68
$test->{pat} = qr/^66100020000$datepat/;
85
$test->{pat} = qr/^66100020000$datepat/;
Lines 86-92 $test->{fields} = [ Link Here
86
	       $SIPtest::field_specs{(FID_PRINT_LINE)},
103
	       $SIPtest::field_specs{(FID_PRINT_LINE)},
87
		  ];
104
		  ];
88
105
89
push @tests, $checkout_templates[0], $test, $checkin_templates[0];
106
push @tests, $reset_checkin_templates[0], $checkout_templates[0], $test, $checkin_templates[0];
90
107
91
$test = clone($renew_all_test_template);
108
$test = clone($renew_all_test_template);
92
$test->{id} = 'Renew All: invalid patron';
109
$test->{id} = 'Renew All: invalid patron';
93
- 

Return to bug 9848