Lines 942-948
subtest 'get_volumes_query' => sub {
Link Here
|
942 |
); |
942 |
); |
943 |
}; |
943 |
}; |
944 |
|
944 |
|
945 |
subtest 'orders() and active_orders() tests' => sub { |
945 |
subtest 'orders() and uncancelled_orders() tests' => sub { |
946 |
|
946 |
|
947 |
plan tests => 5; |
947 |
plan tests => 5; |
948 |
|
948 |
|
Lines 950-960
subtest 'orders() and active_orders() tests' => sub {
Link Here
|
950 |
|
950 |
|
951 |
my $biblio = $builder->build_sample_biblio(); |
951 |
my $biblio = $builder->build_sample_biblio(); |
952 |
|
952 |
|
953 |
my $orders = $biblio->orders; |
953 |
my $orders = $biblio->orders; |
954 |
my $active_orders = $biblio->active_orders; |
954 |
my $uncancelled_orders = $biblio->uncancelled_orders; |
955 |
|
955 |
|
956 |
is( ref($orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
956 |
is( ref($orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
957 |
is( $biblio->orders->count, $biblio->active_orders->count, '->orders->count returns the count for the resultset' ); |
957 |
is( |
|
|
958 |
$biblio->orders->count, $biblio->uncancelled_orders->count, |
959 |
'->orders->count returns the count for the resultset' |
960 |
); |
958 |
|
961 |
|
959 |
# Add a couple orders |
962 |
# Add a couple orders |
960 |
foreach (1..2) { |
963 |
foreach (1..2) { |
Lines 979-990
subtest 'orders() and active_orders() tests' => sub {
Link Here
|
979 |
} |
982 |
} |
980 |
); |
983 |
); |
981 |
|
984 |
|
982 |
$orders = $biblio->orders; |
985 |
$orders = $biblio->orders; |
983 |
$active_orders = $biblio->active_orders; |
986 |
$uncancelled_orders = $biblio->uncancelled_orders; |
984 |
|
987 |
|
985 |
is( ref($orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
988 |
is( ref($orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
986 |
is( ref($active_orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
989 |
is( ref($uncancelled_orders), 'Koha::Acquisition::Orders', 'Result type is correct' ); |
987 |
is( $orders->count, $active_orders->count + 2, '->active_orders->count returns the rigt count' ); |
990 |
is( $orders->count, $uncancelled_orders->count + 2, '->uncancelled_orders->count returns the right count' ); |
988 |
|
991 |
|
989 |
$schema->storage->txn_rollback; |
992 |
$schema->storage->txn_rollback; |
990 |
}; |
993 |
}; |
991 |
- |
|
|