| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace Tests\Services\OrderService;
- use App\OracleDOCOrderHeader;
- use App\Order;
- use App\Owner;
- use App\Services\OrderService;
- use Carbon\Carbon;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- use Illuminate\Foundation\Testing\WithFaker;
- use Illuminate\Support\Str;
- use Tests\TestCase;
- class CreateOrFindOrderInfoTest extends TestCase
- {
- /**
- * @var OrderService $orderService
- */
- public $orderService;
- public $data = [];
- public $order ;
- public function setUp(): void
- {
- parent::setUp(); // TODO: Change the autogenerated stub
- $this->orderService = app('OrderService');
- $this->data['orderHeader'] = OracleDOCOrderHeader::query()->orderBy('addTime')->first();
- }
- public function testCreateOrFindOrderInfo()
- {
- $this->orderService->createOrFindOrderInfo($this->data['orderHeader']);
- $order =Order::query()->where('code',$this->data['orderHeader']['orderno'])->first();
- $this->assertNotNull($order);
- $this->order = $order;
- $this->assertEquals($order->code,$this->data['orderHeader']['orderno']);
- $this->order->delete();
- }
- }
|