Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/mcoil.corals.io/tests/Feature/Admin/Orders/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/mcoil.corals.io/tests/Feature/Admin/Orders/OrderFeatureTest.php
<?php

namespace Tests\Feature\Admin\Orders;

use App\Shop\Customers\Customer;
use App\Shop\Orders\Order;
use App\Shop\Orders\Repositories\OrderRepository;
use App\Shop\Products\Product;
use Illuminate\Support\Str;
use Tests\TestCase;

class OrderFeatureTest extends TestCase
{
    /** @test */
    public function it_can_search_for_the_order()
    {
        $customer = factory(Customer::class)->create();
        factory(Order::class)->create([
            'customer_id' => $customer->id
        ]);

        $this
            ->actingAs($this->employee, 'employee')
            ->get(route('admin.orders.index', ['q' => Str::limit($customer->first_name, 5, '')]))
            ->assertStatus(200)
            ->assertSee($customer->first_name);
    }
    
    /** @test */
    public function it_can_show_the_order()
    {
        $order = factory(Order::class)->create();

        $product = factory(Product::class)->create();

        $orderRepo = new OrderRepository($order);
        $orderRepo->associateProduct($product);

        $this
            ->actingAs($this->employee, 'employee')
            ->get(route('admin.orders.show', $order->id))
            ->assertStatus(200)
            ->assertSee($order->reference)
            ->assertSee('SKU')
            ->assertSee('Name')
            ->assertSee('Description')
            ->assertSee('Quantity')
            ->assertSee('Price');
    }

    /** @test */
    public function it_can_list_all_the_orders()
    {
        factory(Order::class)->create();

        $this
            ->actingAs($this->employee, 'employee')
            ->get(route('admin.orders.index'))
            ->assertStatus(200);
    }
}

Spamworldpro Mini