| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace Tests\Services\OwnerStoreOutFeeReportService;
- use App\OwnerBillReport;
- use App\OwnerFeeDetail;
- use App\OwnerPriceOperation;
- use App\OwnerStoreFeeDetail;
- use App\OwnerStoreFeeReport;
- use App\OwnerStoreOutFeeDetail;
- use App\Services\OwnerStoreOutFeeReportService;
- use Tests\TestCase;
- use App\OwnerStoreOutFeeReport;
- use App\Traits\TestMockSubServices;
- class RecordReportTest extends TestCase
- {
- use TestMockSubServices;
- /** @var OwnerStoreOutFeeReportService $service */
- public $service;
- private $data;
- private $amount = 2;
- function setUp(): void
- {
- parent::setUp();
- $this->service = app('OwnerStoreOutFeeReportService');
- }
- public function testReturned()
- {
- // OwnerPriceOperation::query()->truncate();
- // OwnerFeeDetail::query()->truncate();
- // OwnerStoreOutFeeDetail::query()->truncate();
- // OwnerBillReport::query()->truncate();
- // OwnerStoreOutFeeReport::query()->truncate();
- // $ownerPriceOperationIds = factory(OwnerPriceOperation::class)->times(10)->create()->pluck('id');
- // $ownerFeeDetailIds = [];
- // foreach ($ownerPriceOperationIds as $ownerPriceOperationId) {
- // $ownerFeeDetailIds[] = factory(OwnerFeeDetail::class)->create(['owner_price_operation_id' => $ownerPriceOperationId]);
- // }
- // foreach ($ownerFeeDetailIds as $ownerFeeDetailId) {
- // $details = factory(OwnerStoreOutFeeDetail::class)->times(2)->create(['owner_fee_detail_id' => $ownerFeeDetailId]);
- // foreach ($details as $detail) {
- // factory(OwnerBillReport::class)->create(['owner_id' => $detail->owner_id, 'counting_month' => $detail->created_at->startOfMonth()->toDateString()]);
- // }
- // }
- // $this->service->recordReport();
- $this->assertTrue(true);
- }
- public function testReturned2()
- {
- // OwnerFeeDetail::query()->truncate();
- // OwnerStoreOutFeeDetail::query()->truncate();
- // OwnerStoreOutFeeReport::query()->truncate();
- // $feeDetails = factory(OwnerFeeDetail::class)->times(10)->create(['owner_id' => 8]);
- // foreach ($feeDetails as $feeDetail) {
- // factory(OwnerStoreOutFeeDetail::class)->create([
- // 'owner_fee_detail_id' => $feeDetail->id,
- // 'owner_id' => 8,
- // 'work_name' => 'aaa',
- // 'unit_price' => '1000',
- // 'unit_id' => 1,
- // 'amount' => 10,
- // 'remark' => 'vbbbb',
- // 'step' => '100-200',
- // ]);
- // }
- // $this->service->recordReport();
- $this->assertTrue(true);
- }
- function tearDown(): void
- {
- parent::tearDown();
- }
- }
|