30 lines
639 B
PHP
30 lines
639 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Models\OrderProfit;
|
|
use App\Services\DistributeService;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Tests\TestCase;
|
|
|
|
class ExampleTest extends TestCase
|
|
{
|
|
/**
|
|
* A basic test example.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function test_example()
|
|
{
|
|
$service = new DistributeService();
|
|
try {
|
|
DB::beginTransaction();
|
|
$service->wechatTransfers(OrderProfit::whereIn('id', [1, 5])->get());
|
|
DB::commit();
|
|
} catch (\Exception $e) {
|
|
DB::rollBack();
|
|
}
|
|
}
|
|
}
|