<?php

namespace Tests\Services\OrderPackageReceivedSyncService;

use App\OrderPackage;
use App\Services\OrderPackageReceivedSyncService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class TestGetLogisticRoutes extends TestCase
{
    protected $order_package_ids;

    /** @var OrderPackageReceivedSyncService $service */
    public $service;

    function setUp(): void
    {
        parent::setUp();
        $this->service = app(OrderPackageReceivedSyncService::class);
    }

    public function testReturned()
    {
        $this->assertTrue(true);
    }

    function tearDown(): void
    {
        OrderPackage::destroy($this->order_package_ids);
        parent::tearDown();
    }

    /**
     * 测试顺丰接口连通性
     * @throws \Exception
     * @test
     */
    public function getMessage()
    {
        $data = ['SF' => ['SF1038651915891', 'SF1038651413847', 'SF1038611050071']];
        $result = $this->service->getLogisticRoutes($data);
        $this->assertCount(3,$result);
    }
}
