Skip to content

Commit 49b6648

Browse files
committed
Start an application so we don't need to mock helpers functions
1 parent 18d03cb commit 49b6648

File tree

6 files changed

+23
-41
lines changed

6 files changed

+23
-41
lines changed

composer.json

+9-14
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,22 @@
3434
"symfony/cache": "^6.0|^7.0",
3535
"symfony/serializer": "^5.0|^6.0|^7.0"
3636
},
37-
"conflict": {
38-
"laravel/lumen": "*"
39-
},
4037
"require-dev": {
4138
"doctrine/coding-standard": "^12.0",
42-
"illuminate/log": "^10.0|^11.0",
43-
"illuminate/notifications": "^10.0|^11.0",
44-
"illuminate/queue": "^10.0|^11.0",
39+
"illuminate/log": "^10.0 || ^11.0",
40+
"illuminate/notifications": "^10.0 || ^11.0",
41+
"illuminate/queue": "^10.0 || ^11.0",
4542
"mockery/mockery": "^1.6.12",
4643
"nikic/php-parser": "^4.19 || ^5.0",
4744
"php-parallel-lint/php-parallel-lint": "^1.4",
4845
"phpstan/phpstan": "^1.9",
4946
"phpstan/phpstan-deprecation-rules": "^1.1",
5047
"phpunit/phpunit": "^9.3",
51-
"fakerphp/faker": "^1.23"
48+
"fakerphp/faker": "^1.23",
49+
"laravel/framework": "^10.0 || ^11.0"
50+
},
51+
"conflict": {
52+
"laravel/lumen": "*"
5253
},
5354
"autoload": {
5455
"psr-4": {
@@ -61,13 +62,7 @@
6162
"autoload-dev": {
6263
"psr-4": {
6364
"LaravelDoctrineTest\\ORM\\": "tests/"
64-
},
65-
"files": [
66-
"tests/helpers.php"
67-
],
68-
"classmap": [
69-
"tests"
70-
]
65+
}
7166
},
7267
"suggest": {
7368
"fzaninotto/faker": "Required to use the entity factory builder (~1.4).",

phpstan.neon

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
parameters:
22
level: 0
3-
bootstrapFiles:
4-
- tests/helpers.php
53
paths:
64
- src

tests/Feature/Configuration/Cache/FileCacheProviderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function getProvider()
1313
{
1414
$config = m::mock(Repository::class);
1515
$config->shouldReceive('get')
16-
->with('cache.stores.file.path', 'framework/cache')
16+
->with('cache.stores.file.path', '/storage/framework/cache')
1717
->once()
1818
->andReturn('/tmp');
1919

tests/Feature/Configuration/Cache/PhpFileCacheProviderTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function getProvider()
1313
{
1414
$config = m::mock(Repository::class);
1515
$config->shouldReceive('get')
16-
->with('cache.stores.file.path', 'framework/cache')
16+
->with('cache.stores.file.path', '/storage/framework/cache')
1717
->once()
1818
->andReturn('/tmp');
1919

tests/TestCase.php

+12
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,20 @@
22

33
namespace LaravelDoctrineTest\ORM;
44

5+
use Illuminate\Foundation\Application;
56
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
67

78
class TestCase extends PHPUnitTestCase
89
{
10+
private Application $application;
11+
12+
protected function setUp(): void
13+
{
14+
$this->application = new Application();
15+
}
16+
17+
protected function tearDown(): void
18+
{
19+
unset($this->application);
20+
}
921
}

tests/helpers.php

-23
This file was deleted.

0 commit comments

Comments
 (0)