Migrate billing from Paddle to Lemon Squeezy
This commit is contained in:
31
tests/Unit/PackageLemonSqueezyLinkTest.php
Normal file
31
tests/Unit/PackageLemonSqueezyLinkTest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Models\Package;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PackageLemonSqueezyLinkTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_link_lemonsqueezy_ids_updates_fields(): void
|
||||
{
|
||||
$package = Package::factory()->create([
|
||||
'lemonsqueezy_product_id' => null,
|
||||
'lemonsqueezy_variant_id' => null,
|
||||
'lemonsqueezy_sync_status' => null,
|
||||
'lemonsqueezy_synced_at' => null,
|
||||
]);
|
||||
|
||||
$package->linkLemonSqueezyIds('pro_123', 'pri_123');
|
||||
|
||||
$package->refresh();
|
||||
|
||||
$this->assertSame('pro_123', $package->lemonsqueezy_product_id);
|
||||
$this->assertSame('pri_123', $package->lemonsqueezy_variant_id);
|
||||
$this->assertSame('linked', $package->lemonsqueezy_sync_status);
|
||||
$this->assertNotNull($package->lemonsqueezy_synced_at);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user