Created
April 24, 2022 11:41
-
-
Save tkaratug/21a1282399d04fc15c3ec46e7fea3239 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use Tests\TestCase; | |
use App\Models\Order; | |
class OrderControllerTest extends TestCase | |
{ | |
public function it_returns_paid_and_delivered_orders_sorted_by_created_at_desc(): void | |
{ | |
$orders = Order::factory()->count(20)->create(); | |
$response = $this->get(route('orders.index')); | |
$response->assertOk(); | |
$this->assertScopeCalled('paid', Order::class); | |
$this->assertScopeCalled('delivered', Order::class); | |
$this->assertScopeCalled('createdAtDesc', Order::class); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment