QueryTest.php 784 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace LogisticYTOService;
  3. use App\OrderPackage;
  4. use App\Services\LogisticYDService;
  5. use Illuminate\Support\Facades\Http;
  6. use Tests\TestCase;
  7. class QueryTest extends TestCase
  8. {
  9. /**
  10. * @var $service LogisticYDService
  11. */
  12. private $service;
  13. protected function setUp(): void
  14. {
  15. parent::setUp(); // TODO: Change the autogenerated stub
  16. $this->service = app('LogisticYTOService');
  17. }
  18. /**
  19. * @test
  20. */
  21. public function prod_test()
  22. {
  23. // 'YT5481469185320';YT3153735030684
  24. $response = $this->service->query('YT5481469185320');
  25. dump($response);
  26. if (is_object($response))$this->assertEquals('1001', $response->code);
  27. if (!is_object($response))$this->assertNotEmpty($response);
  28. }
  29. }