Permalink
Browse files

[整合測試] ShippingService 使用 interface

  • Loading branch information...
1 parent c25e203 commit ffabd0f165734227fce1e39996869d128739a055 Sam.IO.Hsiao committed Nov 18, 2016
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/ShippingServiceTest.php
@@ -30,4 +30,21 @@ public function 黑貓單元測試()
$expected = 110;
$this->assertEquals($expected, $actual);
}
+
+ /** @test */
+ public function 黑貓整合測試()
+ {
+ /** arrange */
+ App::bind(LogisticsInterface::class, BlackCat::class);
+
+ /** act */
+ $weight = 1;
+ $actual = App::call(ShippingService::class . '@calculateFee', [
+ 'weight' => $weight,
+ ]);
+
+ /** assert */
+ $expected = 110;
+ $this->assertEquals($expected, $actual);
+ }
}

0 comments on commit ffabd0f

Please sign in to comment.