@@ -592,4 +592,90 @@ public function testGettingOrderProductsCountCountsToTheOrderProductsResource()
592592 $ count = Client::getOrderProductsCount (1 );
593593 $ this ->assertSame (7 , $ count );
594594 }
595+
596+ public function testGettingOrderShipmentReturnsTheOrderShipmentResource ()
597+ {
598+ $ this ->connection ->expects ($ this ->once ())
599+ ->method ('get ' )
600+ ->with ('/orders/1/shipments/1 ' , false )
601+ ->will ($ this ->returnValue (array (array (), array ())));
602+
603+ $ resource = Client::getShipment (1 , 1 );
604+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resources \\Shipment ' , $ resource );
605+ }
606+
607+ public function testGettingOrderShipmentsReturnsTheOrderShipmentsResource ()
608+ {
609+ $ this ->connection ->expects ($ this ->once ())
610+ ->method ('get ' )
611+ ->with ('/orders/1/shipments ' , false )
612+ ->will ($ this ->returnValue (array (array (), array ())));
613+
614+ $ collection = Client::getShipments (1 );
615+ $ this ->assertInternalType ('array ' , $ collection );
616+ foreach ($ collection as $ resource ) {
617+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resources \\Shipment ' , $ resource );
618+ }
619+ }
620+
621+ public function testCreatingOrderShipmentsPostsToTheOrderShipmentsResource ()
622+ {
623+ $ this ->connection ->expects ($ this ->once ())
624+ ->method ('post ' )
625+ ->with ('/orders/1/shipments ' , (object )array ());
626+
627+ Client::createShipment (1 , array ());
628+ }
629+
630+ public function testUpdatingOrderShipmentsPutsToTheOrderShipmentsResource ()
631+ {
632+ $ this ->connection ->expects ($ this ->once ())
633+ ->method ('put ' )
634+ ->with ('/orders/1/shipments/1 ' , (object )array ());
635+
636+ Client::updateShipment (1 , 1 , array ());
637+ }
638+
639+ public function testDeletingAllOrderShipmentsDeletesToTheOrderShipmentResource ()
640+ {
641+ $ this ->connection ->expects ($ this ->once ())
642+ ->method ('delete ' )
643+ ->with ('/orders/1/shipments ' );
644+
645+ Client::deleteAllShipmentsForOrder (1 );
646+ }
647+
648+ public function testDeletingAnOrderShipmentDeletesToTheOrderShipmentResource ()
649+ {
650+ $ this ->connection ->expects ($ this ->once ())
651+ ->method ('delete ' )
652+ ->with ('/orders/1/shipments/1 ' );
653+
654+ Client::deleteShipment (1 , 1 );
655+ }
656+
657+ public function testGettingOrderShippingAddressReturnsTheAddressResource ()
658+ {
659+ $ this ->connection ->expects ($ this ->once ())
660+ ->method ('get ' )
661+ ->with ('/orders/1/shipping_addresses/1 ' , false )
662+ ->will ($ this ->returnValue (array (array (), array ())));
663+
664+ $ resource = Client::getOrderShippingAddress (1 , 1 );
665+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resources \\Address ' , $ resource );
666+ }
667+
668+ public function testGettingOrderShippingAddressesReturnsTheAddressResource ()
669+ {
670+ $ this ->connection ->expects ($ this ->once ())
671+ ->method ('get ' )
672+ ->with ('/orders/1/shipping_addresses ' , false )
673+ ->will ($ this ->returnValue (array (array (), array ())));
674+
675+ $ collection = Client::getOrderShippingAddresses (1 );
676+ $ this ->assertInternalType ('array ' , $ collection );
677+ foreach ($ collection as $ resource ) {
678+ $ this ->assertInstanceOf ('Bigcommerce \\Api \\Resources \\Address ' , $ resource );
679+ }
680+ }
595681}
0 commit comments