| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace Tests\Unit\StationRuleBatchService;
- use App\Batch;
- use App\Owner;
- use App\Services\BatchService;
- use App\Services\OwnerService;
- use App\Services\StationRuleBatchService;
- use App\StationRuleBatch;
- use Tests\TestCase;
- class GetBatches_shouldProcessTest extends TestCase
- {
- /** @var StationRuleBatchService $service */
- private $service;
- /** @var BatchService $batchService */
- private $batchService;
- private $data = [];
- public function setUp(): void
- {
- parent::setUp();
- $this->service = app('StationRuleBatchService');
- $this->batchService = app('BatchService');
- $this->data['stationRuleBatches'] = factory(StationRuleBatch::class)
- ->create([]);
- $this->data['batches'] = factory(Batch::class,3)->create([
- ]);
- }
- /**
- * @test
- */
- public function getShopByCodeMap()
- {
- $shop = $this->service->getShopByCodeMap($this->data['map']);
- $this->assertNotNull($shop);
- $orderHeader = $this->data['orderHeader'];
- $owner = Owner::find($shop->first()->owner_id);
- $this->assertEquals($owner->code,$orderHeader['customerid']);
- $this->assertEquals($shop->first()->name,$orderHeader['issuepartyname']);
- }
- public function tearDown(): void
- {
- cache()->flush();
- parent::tearDown(); // TODO: Change the autogenerated stub
- }
- }
|