40 lines
692 B
PHP
40 lines
692 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
use CreatesApplication;
|
|
|
|
/**
|
|
* Setup the test environment.
|
|
*/
|
|
protected function setUp(): void
|
|
{
|
|
parent::setUp();
|
|
}
|
|
|
|
/**
|
|
* Post with token
|
|
*/
|
|
public function _post()
|
|
{
|
|
return $this->withHeaders([
|
|
'accept' => 'application/json',
|
|
'api_token' => config('ecommerce.api.token'),
|
|
]);
|
|
}
|
|
|
|
/**
|
|
* Add header json
|
|
*/
|
|
public function asJson()
|
|
{
|
|
return $this->withHeaders([
|
|
'accept' => 'application/json',
|
|
]);
|
|
}
|
|
}
|