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

(-)a/t/db_dependent/api/v1/holds.t (-2 / +27 lines)
Lines 687-693 subtest 'add() tests (maxreserves behaviour)' => sub { Link Here
687
687
688
subtest 'pickup_locations() tests' => sub {
688
subtest 'pickup_locations() tests' => sub {
689
689
690
    plan tests => 9;
690
    plan tests => 10;
691
691
692
    $schema->storage->txn_begin;
692
    $schema->storage->txn_begin;
693
693
Lines 803-808 subtest 'pickup_locations() tests' => sub { Link Here
803
          . '/pickup_locations?q={"marc_org_code": { "-like": "A%" }}' )
803
          . '/pickup_locations?q={"marc_org_code": { "-like": "A%" }}' )
804
      ->json_is( [ $library_1->to_api ] );
804
      ->json_is( [ $library_1->to_api ] );
805
805
806
    subtest 'x-koha-override + AllowHoldPolicyOverride tests' => sub {
807
808
        plan tests => 6;
809
810
        my $allowholdpolicyoverride = C4::Context->preference('AllowHoldPolicyOverride');
811
812
        t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 1 );
813
814
        my $pickup_locations = Koha::Libraries->search({ pickup_location => 1 });
815
816
        $t->get_ok( "//$userid:$password@/api/v1/holds/"
817
            . $hold_1->id
818
            . "/pickup_locations"
819
            => { 'x-koha-override' => 'any' } )
820
        ->json_is( $pickup_locations->to_api );
821
822
        t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', 0 );
823
824
        $t->get_ok( "//$userid:$password@/api/v1/holds/"
825
            . $hold_1->id
826
            . "/pickup_locations"
827
            => { 'x-koha-override' => 'any' } )
828
        ->json_is( $hold_1->biblio->pickup_locations({ patron => $patron })->to_api );
829
830
        t::lib::Mocks::mock_preference( 'AllowHoldPolicyOverride', $allowholdpolicyoverride );
831
    };
806
832
807
    $schema->storage->txn_rollback;
833
    $schema->storage->txn_rollback;
808
};
834
};
809
- 

Return to bug 27863