<?php

namespace Tests\Services\OrderIssueService\RecoverOrderIssueTest;

use App\OrderIssue;
use App\Services\OrderIssueService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class RecoverOrderIssueTest extends TestCase
{
    /**
     * @var OrderIssueService $service
     */
    public $service;
    public $data = [];

    public function setUp(): void
    {
        parent::setUp(); // TODO: Change the autogenerated stub
        $this->service = app('OrderIssueService');
        $this->data['orderIssue'] = factory(OrderIssue::class)->create();
        $this->data['orderIssue']->delete();
    }

    public function testRecoverOrderIssue()
    {
        $ids = [$this->data['orderIssue']['id']];
        $this->service->recoverOrderIssue($ids);
        $orderIssue = OrderIssue::query()->where('id',$ids[0])->first();
        $this->assertNotEmpty($orderIssue);
    }
}
