Skip to content

Commit

Permalink
Merge pull request #634 from TomHAnderson/feature/test-application
Browse files Browse the repository at this point in the history
Start an application so we don't need to mock helpers functions
  • Loading branch information
TomHAnderson authored Oct 28, 2024
2 parents 18d03cb + 49b6648 commit 1eca26b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 41 deletions.
23 changes: 9 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,22 @@
"symfony/cache": "^6.0|^7.0",
"symfony/serializer": "^5.0|^6.0|^7.0"
},
"conflict": {
"laravel/lumen": "*"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"illuminate/log": "^10.0|^11.0",
"illuminate/notifications": "^10.0|^11.0",
"illuminate/queue": "^10.0|^11.0",
"illuminate/log": "^10.0 || ^11.0",
"illuminate/notifications": "^10.0 || ^11.0",
"illuminate/queue": "^10.0 || ^11.0",
"mockery/mockery": "^1.6.12",
"nikic/php-parser": "^4.19 || ^5.0",
"php-parallel-lint/php-parallel-lint": "^1.4",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpunit/phpunit": "^9.3",
"fakerphp/faker": "^1.23"
"fakerphp/faker": "^1.23",
"laravel/framework": "^10.0 || ^11.0"
},
"conflict": {
"laravel/lumen": "*"
},
"autoload": {
"psr-4": {
Expand All @@ -61,13 +62,7 @@
"autoload-dev": {
"psr-4": {
"LaravelDoctrineTest\\ORM\\": "tests/"
},
"files": [
"tests/helpers.php"
],
"classmap": [
"tests"
]
}
},
"suggest": {
"fzaninotto/faker": "Required to use the entity factory builder (~1.4).",
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
parameters:
level: 0
bootstrapFiles:
- tests/helpers.php
paths:
- src
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getProvider()
{
$config = m::mock(Repository::class);
$config->shouldReceive('get')
->with('cache.stores.file.path', 'framework/cache')
->with('cache.stores.file.path', '/storage/framework/cache')
->once()
->andReturn('/tmp');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getProvider()
{
$config = m::mock(Repository::class);
$config->shouldReceive('get')
->with('cache.stores.file.path', 'framework/cache')
->with('cache.stores.file.path', '/storage/framework/cache')
->once()
->andReturn('/tmp');

Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,20 @@

namespace LaravelDoctrineTest\ORM;

use Illuminate\Foundation\Application;
use PHPUnit\Framework\TestCase as PHPUnitTestCase;

class TestCase extends PHPUnitTestCase
{
private Application $application;

protected function setUp(): void
{
$this->application = new Application();
}

protected function tearDown(): void
{
unset($this->application);
}
}
23 changes: 0 additions & 23 deletions tests/helpers.php

This file was deleted.

0 comments on commit 1eca26b

Please sign in to comment.