<?php


namespace Tests\Services\StoreItemService;


use App\OracleBasCode;
use App\OracleDOCASNDetail;
use App\OracleDOCASNHeader;
use App\Owner;
use App\Services\OwnerService;
use App\Services\StoreItemService;
use App\Services\StoreService;
use App\Services\WarehouseService;
use App\Store;
use App\Warehouse;
use Carbon\Carbon;
use Tests\TestCase;

class GetAsnDetailsByAsnHerderTest extends TestCase
{
    /**
     * @var StoreService $service
     * @var OwnerService $ownerService
     * @var WarehouseService $warehouseService
     *
     */
    public $service;
    public $asnHeaders;
    public function setUp(): void
    {
        parent::setUp(); // TODO: Change the autogenerated stub
        $this->service=app(StoreItemService::class);
        $this->asnHeaders=collect();
        $asnHeader=OracleDOCASNHeader::query()->with('asnDetails')->first();
        if (count($asnHeader->asnDetails)>0)$this->asnHeaders->add($asnHeader);

    }
    public function testGetAsnDetailsByAsnHerder(){
        ini_set('memory_limit','512M');
        if (count($this->asnHeaders)<1)  {
            $this->assertEquals(0,count($this->asnHeaders));
        }else{
            $asnDetails=$this->service->getAsnDetailsByAsnHerder($this->asnHeaders);
            $this->assertNotEmpty($asnDetails);
        }
    }
}
