File tree Expand file tree Collapse file tree 5 files changed +46
-2
lines changed
tests/Services/Shipping/PriceService Expand file tree Collapse file tree 5 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace KiriminAja \Enums ;
4+
5+ enum ExpressService: string
6+ {
7+ case Tiki = "tiki " ;
8+ case Pos = "posindonesia " ;
9+ case Paxel = "paxel " ;
10+ case Ninja = "ninja " ;
11+ case RPX = "rpx " ;
12+ case LionParcel = "lion " ;
13+ case JTCargo = "jtcargo " ;
14+ case SentralCargo = "sentral " ;
15+ case AnterAja = "anteraja " ;
16+ case NCS = "ncs " ;
17+ case Sicepat = "sicepat " ;
18+ case SAP = "sap " ;
19+ case IDExpress = "idx " ;
20+ case JNE = "jne " ;
21+ case JNT = "jnt " ;
22+ case SPX = "spx " ;
23+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace KiriminAja \Enums ;
4+
5+ enum InstantService: string
6+ {
7+ case GrabExpress = "grab_express " ;
8+ case Borzo = "borzo " ;
9+ case GoSend = "gosend " ;
10+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace KiriminAja \Enums ;
4+
5+ enum InstantVehicle: string
6+ {
7+ case Bike = "motor " ;
8+ case Car = "mobil " ;
9+ }
Original file line number Diff line number Diff line change 44
55require_once (__DIR__ .'/../ShippingMock.php ' );
66
7+ use KiriminAja \Enums \ExpressService ;
78use KiriminAja \Models \ShippingPriceData ;
89use KiriminAja \Services \Shipping \PriceService ;
910use KiriminAja \Services \Shipping \ShippingMock ;
@@ -28,7 +29,7 @@ public function testFailedService()
2829 $ shipping_price_object ->weight = 1000 ;
2930 $ shipping_price_object ->insurance = 1 ;
3031 $ shipping_price_object ->item_value = 100000 ;
31- $ shipping_price_object ->courier = [' jne ' ];
32+ $ shipping_price_object ->courier = [ExpressService:: JNE -> value , ' other ' ];
3233
3334 (new ShippingMock ())->shippingMock ()
3435 ->shouldReceive ([
Original file line number Diff line number Diff line change 44
55require_once (__DIR__ .'/../ShippingMock.php ' );
66
7+ use KiriminAja \Enums \ExpressService ;
78use KiriminAja \Models \ShippingPriceData ;
89use KiriminAja \Services \Shipping \PriceService ;
910use KiriminAja \Services \Shipping \ShippingMock ;
@@ -58,7 +59,7 @@ public function test()
5859 $ shipping_price_object ->weight = 1000 ;
5960 $ shipping_price_object ->insurance = 1 ;
6061 $ shipping_price_object ->item_value = 100000 ;
61- $ shipping_price_object ->courier = [' jne ' ];
62+ $ shipping_price_object ->courier = [ExpressService:: JNE -> value , ' other ' ];
6263
6364 $ result = (new PriceService ($ shipping_price_object ))->call ();
6465
You can’t perform that action at this time.
0 commit comments