RecordReportTest.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace Tests\Services\OwnerStoreOutFeeReportService;
  3. use App\OwnerBillReport;
  4. use App\OwnerFeeDetail;
  5. use App\OwnerPriceOperation;
  6. use App\OwnerStoreFeeDetail;
  7. use App\OwnerStoreFeeReport;
  8. use App\OwnerStoreOutFeeDetail;
  9. use App\Services\OwnerStoreOutFeeReportService;
  10. use Tests\TestCase;
  11. use App\OwnerStoreOutFeeReport;
  12. use App\Traits\TestMockSubServices;
  13. class RecordReportTest extends TestCase
  14. {
  15. use TestMockSubServices;
  16. /** @var OwnerStoreOutFeeReportService $service */
  17. public $service;
  18. private $data;
  19. private $amount = 2;
  20. function setUp(): void
  21. {
  22. parent::setUp();
  23. $this->service = app('OwnerStoreOutFeeReportService');
  24. }
  25. public function testReturned()
  26. {
  27. // OwnerPriceOperation::query()->truncate();
  28. // OwnerFeeDetail::query()->truncate();
  29. // OwnerStoreOutFeeDetail::query()->truncate();
  30. // OwnerBillReport::query()->truncate();
  31. // OwnerStoreOutFeeReport::query()->truncate();
  32. // $ownerPriceOperationIds = factory(OwnerPriceOperation::class)->times(10)->create()->pluck('id');
  33. // $ownerFeeDetailIds = [];
  34. // foreach ($ownerPriceOperationIds as $ownerPriceOperationId) {
  35. // $ownerFeeDetailIds[] = factory(OwnerFeeDetail::class)->create(['owner_price_operation_id' => $ownerPriceOperationId]);
  36. // }
  37. // foreach ($ownerFeeDetailIds as $ownerFeeDetailId) {
  38. // $details = factory(OwnerStoreOutFeeDetail::class)->times(2)->create(['owner_fee_detail_id' => $ownerFeeDetailId]);
  39. // foreach ($details as $detail) {
  40. // factory(OwnerBillReport::class)->create(['owner_id' => $detail->owner_id, 'counting_month' => $detail->created_at->startOfMonth()->toDateString()]);
  41. // }
  42. // }
  43. // $this->service->recordReport();
  44. $this->assertTrue(true);
  45. }
  46. public function testReturned2()
  47. {
  48. // OwnerFeeDetail::query()->truncate();
  49. // OwnerStoreOutFeeDetail::query()->truncate();
  50. // OwnerStoreOutFeeReport::query()->truncate();
  51. // $feeDetails = factory(OwnerFeeDetail::class)->times(10)->create(['owner_id' => 8]);
  52. // foreach ($feeDetails as $feeDetail) {
  53. // factory(OwnerStoreOutFeeDetail::class)->create([
  54. // 'owner_fee_detail_id' => $feeDetail->id,
  55. // 'owner_id' => 8,
  56. // 'work_name' => 'aaa',
  57. // 'unit_price' => '1000',
  58. // 'unit_id' => 1,
  59. // 'amount' => 10,
  60. // 'remark' => 'vbbbb',
  61. // 'step' => '100-200',
  62. // ]);
  63. // }
  64. // $this->service->recordReport();
  65. $this->assertTrue(true);
  66. }
  67. function tearDown(): void
  68. {
  69. parent::tearDown();
  70. }
  71. }