| 123456789101112131415161718192021 |
- <?php
- namespace Webkul\Shop\Tests\Concerns;
- use Webkul\Customer\Contracts\Customer as CustomerContract;
- use Webkul\Faker\Helpers\Customer as CustomerFaker;
- trait ShopTestBench
- {
- /**
- * Login as customer.
- */
- public function loginAsCustomer(?CustomerContract $customer = null): CustomerContract
- {
- $customer = $customer ?? (new CustomerFaker)->factory()->create();
- $this->actingAs($customer);
- return $customer;
- }
- }
|