Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 98e608b

Browse files
author
Carlos Villavicencio
committed
Fix memory tests
1 parent dbb55d1 commit 98e608b

File tree

7 files changed

+43
-18
lines changed

7 files changed

+43
-18
lines changed

.github/workflows/laravel.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,4 @@ jobs:
3232
- name: Directory Permissions
3333
run: chmod -R 777 storage bootstrap/cache
3434
- name: Execute tests (Unit and Feature tests) via PHPUnit
35-
env:
36-
DB_CONNECTION: sqlite
37-
DB_DATABASE: database/database.sqlite
3835
run: vendor/bin/phpunit

config/app.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
return [
44

5+
/*
6+
|--------------------------------------------------------------------------
7+
| Application Name
8+
|--------------------------------------------------------------------------
9+
|
10+
| This value is the name of your application. This value is used when the
11+
| framework needs to place the application's name in a notification or
12+
| any other location as required by the application or its packages.
13+
|
14+
*/
15+
16+
'name' => env('APP_NAME', 'Laravel'),
17+
18+
/*
19+
|--------------------------------------------------------------------------
20+
| Application Environment
21+
|--------------------------------------------------------------------------
22+
|
23+
| This value determines the "environment" your application is currently
24+
| running in. This may determine how you prefer to configure various
25+
| services the application utilizes. Set this in your ".env" file.
26+
|
27+
*/
28+
29+
'env' => env('APP_ENV', 'production'),
30+
531
/*
632
|--------------------------------------------------------------------------
733
| Application Debug Mode

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<server name="BCRYPT_ROUNDS" value="4"/>
2424
<server name="CACHE_DRIVER" value="array"/>
2525
<server name="SESSION_DRIVER" value="array"/>
26-
<server name="QUEUE_DRIVER" value="sync"/>
26+
<server name="QUEUE_CONNECTION" value="sync"/>
2727
<server name="DB_CONNECTION" value="testing"/>
2828
</php>
2929
</phpunit>

tests/ReservationControllerTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
<?php
2+
namespace Tests;
3+
24
use Illuminate\Foundation\Testing\WithoutMiddleware;
35
use Illuminate\Foundation\Testing\DatabaseMigrations;
46
use Illuminate\Foundation\Testing\DatabaseTransactions;
57
use App\VacationProperty;
68
use App\Reservation;
79
use App\User;
810
use Twilio\Rest\Client;
11+
use Mockery;
12+
use SimpleXMLElement;
913

1014
class ReservationControllerTest extends TestCase
1115
{

tests/TestCase.php

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php
2+
namespace Tests;
23

3-
class TestCase extends Illuminate\Foundation\Testing\TestCase
4+
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
5+
use Illuminate\Contracts\Console\Kernel;
6+
use Illuminate\Foundation\Testing\DatabaseMigrations;
7+
8+
class TestCase extends BaseTestCase
49
{
10+
use DatabaseMigrations;
511
/**
612
* The base URL to use while testing the application.
713
*
@@ -18,20 +24,8 @@ public function createApplication()
1824
{
1925
$app = require __DIR__.'/../bootstrap/app.php';
2026

21-
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
27+
$app->make(Kernel::class)->bootstrap();
2228

2329
return $app;
2430
}
25-
26-
protected function setUp(): void
27-
{
28-
parent::setUp();
29-
Artisan::call('migrate');
30-
}
31-
32-
protected function tearDown(): void
33-
{
34-
Artisan::call('migrate:reset');
35-
parent::tearDown();
36-
}
3731
}

tests/UserControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
namespace Tests;
3+
24
use Illuminate\Foundation\Testing\WithoutMiddleware;
35
use Illuminate\Foundation\Testing\DatabaseMigrations;
46
use Illuminate\Foundation\Testing\DatabaseTransactions;

tests/VacationPropertyControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?php
2+
namespace Tests;
3+
24
use Illuminate\Foundation\Testing\WithoutMiddleware;
35
use Illuminate\Foundation\Testing\DatabaseMigrations;
46
use Illuminate\Foundation\Testing\DatabaseTransactions;

0 commit comments

Comments
 (0)