forked from ankurk91/laravel-paypal-webhooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCase.php
47 lines (36 loc) · 1.11 KB
/
TestCase.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
declare(strict_types=1);
namespace Tommmoe\PayPalWebhooks\Tests;
use Tommmoe\PayPalWebhooks\PayPalWebhooksServiceProvider;
use Illuminate\Support\Facades\Route;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
abstract class TestCase extends OrchestraTestCase
{
public function setUp(): void
{
parent::setUp();
Route::paypalWebhooks('/webhooks/paypal');
$this->setUpDatabase();
}
protected function getPackageProviders($app): array
{
return [
PayPalWebhooksServiceProvider::class,
];
}
protected function getEnvironmentSetUp($app): void
{
config()->set('app.debug', false);
config()->set('database.default', 'sqlite');
config()->set('database.connections.sqlite', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}
protected function setUpDatabase(): void
{
$migration = include __DIR__.'/../vendor/spatie/laravel-webhook-client/database/migrations/create_webhook_calls_table.php.stub';
$migration->up();
}
}