Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Documents/ReceiptTest.php
<?php | <?php | ||||
namespace Tests\Feature\Documents; | namespace Tests\Feature\Documents; | ||||
use App\Documents\Receipt; | use App\Documents\Receipt; | ||||
use App\Payment; | use App\Payment; | ||||
use App\Providers\PaymentProvider; | use App\Providers\PaymentProvider; | ||||
use App\User; | use App\User; | ||||
use App\Wallet; | use App\Wallet; | ||||
use Carbon\Carbon; | use Carbon\Carbon; | ||||
use Illuminate\Support\Facades\Bus; | use Illuminate\Support\Facades\Bus; | ||||
use Tests\TestCase; | use Tests\TestCase; | ||||
class ReceiptTest extends TestCase | class ReceiptTest extends TestCase | ||||
{ | { | ||||
public function setUp(): void | |||||
{ | |||||
parent::setUp(); | |||||
$paymentIDs = ['AAA1', 'AAA2', 'AAA3', 'AAA4', 'AAA5', 'AAA6', 'AAA7']; | |||||
foreach ($paymentIDs as $paymentID) { | |||||
machniak: You can just Payment::whereIn('id', $paymentIDs)->delete(). Also, you should do the same in… | |||||
$payment = Payment::where('id', $paymentID)->first(); | |||||
if ($payment) { | |||||
$payment->delete(); | |||||
} | |||||
} | |||||
} | |||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
$this->deleteTestUser('receipt-test@kolabnow.com'); | $this->deleteTestUser('receipt-test@kolabnow.com'); | ||||
parent::tearDown(); | parent::tearDown(); | ||||
▲ Show 20 Lines • Show All 289 Lines • Show Last 20 Lines |
You can just Payment::whereIn('id', $paymentIDs)->delete(). Also, you should do the same in teardown. I guess this might be why the stripe test failed.