Skip to content

Commit 95fd727

Browse files
committed
Fixes tests and fixes base configuration loading
1 parent a17c1e2 commit 95fd727

File tree

7 files changed

+27
-30
lines changed

7 files changed

+27
-30
lines changed

src/Bootstrap/BaseLoadConfiguration.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace LaravelZero\Framework\Bootstrap;
1515

16+
use ReflectionClass;
1617
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
1718
use Illuminate\Foundation\Bootstrap\LoadConfiguration;
1819
use Symfony\Component\Finder\Finder;
@@ -48,4 +49,25 @@ protected function getConfigurationFiles(ApplicationContract $app): array
4849

4950
return $files;
5051
}
52+
53+
/**
54+
* Get the base configuration files.
55+
*
56+
* @return array
57+
*/
58+
protected function getBaseConfiguration()
59+
{
60+
$config = [];
61+
62+
$reflector = new ReflectionClass($this);
63+
$declaringClass = $reflector->getParentClass();
64+
$dir = dirname($declaringClass->getFilename());
65+
66+
foreach (Finder::create()->files()->name('*.php')->in($dir.'/../../../../config') as $file) {
67+
$config[basename($file->getRelativePathname(), '.php')] = require ($file->getPath() . '/' . $file->getFilename());
68+
}
69+
70+
return $config;
71+
}
5172
}
73+

tests/Components/HttpComponentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
it('installs the required packages', function () {
1010
$composerMock = $this->createMock(ComposerContract::class);
1111

12-
$composerMock->expects($this->exactly(2))
12+
$composerMock->expects($this->exactly(1))
1313
->method('require');
1414

1515
$this->app->instance(ComposerContract::class, $composerMock);

tests/Components/LogInstallTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
$composerMock->expects($this->once())
1717
->method('require')
18-
->with('illuminate/log "^10.0"');
18+
->with('illuminate/log "^11.5"');
1919

2020
$this->app->instance(ComposerContract::class, $composerMock);
2121

tests/Components/LogoProviderTest.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/Components/MenuComponentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
$composerMock->expects($this->once())
1212
->method('require')
13-
->with('nunomaduro/laravel-console-menu "^3.4"');
13+
->with('nunomaduro/laravel-console-menu "^3.5"');
1414

1515
$this->app->instance(ComposerContract::class, $composerMock);
1616

tests/Components/RedisInstallTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
$composerMock->expects($this->once())
1212
->method('require')
13-
->with('illuminate/redis "^10.0"', false);
13+
->with('illuminate/redis "^11.5"', false);
1414

1515
$this->app->instance(ComposerContract::class, $composerMock);
1616

tests/Components/UpdaterInstallTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
it('installs the required packages', function () {
99
$composerMock = $this->createMock(ComposerContract::class);
1010

11-
$composerMock->expects($this->once())->method('require')->with('laravel-zero/phar-updater "^1.3"');
11+
$composerMock->expects($this->once())->method('require')->with('laravel-zero/phar-updater "^1.4"');
1212

1313
$this->app->instance(ComposerContract::class, $composerMock);
1414

0 commit comments

Comments
 (0)