Skip to content

Commit

Permalink
Revert PR 1558
Browse files Browse the repository at this point in the history
  • Loading branch information
driesvints committed Aug 31, 2023
1 parent a414a0e commit aec3fcf
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions tests/Unit/InvoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,66 +307,4 @@ public function test_it_can_determine_if_reverse_charge_applies()

$this->assertTrue($invoice->reverseChargeApplies());
}

public function test_it_can_determine_if_is_deleted(): void
{
$customerId = 'foo';

$stripeInvoice = new StripeInvoice();

$stripeInvoice->customer = $customerId;
$stripeInvoice->status = StripeInvoice::STATUS_DELETED;

$user = new User();

$user->stripe_id = $customerId;

$invoice = new Invoice($user, $stripeInvoice);

$this->assertTrue($invoice->isDeleted());
}

/**
* @dataProvider provideInvoiceStatusNotDeleted
*/
public function test_it_can_determine_if_is_not_deleted(string $invoiceStatus): void
{
$customerId = 'foo';

$stripeInvoice = new StripeInvoice();

$stripeInvoice->customer = $customerId;
$stripeInvoice->status = $invoiceStatus;

$user = new User();

$user->stripe_id = $customerId;

$invoice = new Invoice($user, $stripeInvoice);

$this->assertFalse($invoice->isDeleted());
}

/**
* @return array<string, array{0: string}>
*/
public function provideInvoiceStatusNotDeleted(): array
{
$invoiceStatuses = [
StripeInvoice::STATUS_DRAFT,
StripeInvoice::STATUS_OPEN,
StripeInvoice::STATUS_PAID,
StripeInvoice::STATUS_UNCOLLECTIBLE,
StripeInvoice::STATUS_VOID,
];

return array_combine(
$invoiceStatuses,
array_map(static function (string $invoiceStatus): array {
return [
$invoiceStatus,
];
}, $invoiceStatuses)
);
}
}

0 comments on commit aec3fcf

Please sign in to comment.