-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.x] Fixes config:publish
with dontMergeFrameworkConfiguration()
set to true
#51751
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
23cd10e
[11.x] Fixes `config:publish` with `dontMergeFrameworkConfiguration()`
crynobone 57fef6e
wip
crynobone ff2c342
wip
crynobone ea53fe0
Apply fixes from StyleCI
StyleCIBot c9fd802
wip
crynobone 9f46dcf
wip
crynobone 32b67f8
Merge remote-tracking branch 'upstream/fixes-51736' into fixes-51736
crynobone 4dbfc3b
wip
crynobone da8a50a
wip
crynobone 88c4a9b
Apply fixes from StyleCI
StyleCIBot 50922db
wip
crynobone a1f89a8
wip
crynobone 39e06ee
wip
crynobone be04863
Update ConfigPublishCommandTest.php
crynobone e252e69
Apply fixes from StyleCI
StyleCIBot d42f151
Update composer.json
crynobone 6b4d7c0
Update composer.json
crynobone cdc1052
Update ConfigPublishCommandTest.php
crynobone 84913ac
Update composer.json
crynobone 5bca510
wip
crynobone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
tests/Integration/Foundation/Console/ConfigPublishCommandTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
namespace Illuminate\Tests\Integration\Foundation\Console; | ||
|
||
use Illuminate\Filesystem\Filesystem; | ||
use Illuminate\Foundation\Bootstrap\LoadConfiguration; | ||
use Illuminate\Support\ServiceProvider; | ||
use Orchestra\Testbench\Concerns\InteractsWithPublishedFiles; | ||
use Orchestra\Testbench\TestCase; | ||
|
||
use function Orchestra\Testbench\package_path; | ||
|
||
class ConfigPublishCommandTest extends TestCase | ||
{ | ||
use InteractsWithPublishedFiles; | ||
|
||
protected array $files = [ | ||
'config-stubs/*.php', | ||
]; | ||
|
||
#[\Override] | ||
protected function setUp(): void | ||
{ | ||
$files = new Filesystem(); | ||
|
||
$this->afterApplicationCreated(function () use ($files) { | ||
$files->ensureDirectoryExists($this->app->basePath('config-stubs')); | ||
}); | ||
|
||
$this->beforeApplicationDestroyed(function () use ($files) { | ||
$files->deleteDirectory($this->app->basePath('config-stubs')); | ||
}); | ||
|
||
parent::setUp(); | ||
} | ||
|
||
#[\Override] | ||
protected function resolveApplicationConfiguration($app) | ||
{ | ||
$app->instance(LoadConfiguration::class, new LoadConfiguration()); | ||
|
||
$app->useConfigPath($app->basePath('config-stubs')); | ||
|
||
$app->dontMergeFrameworkConfiguration(); | ||
|
||
parent::resolveApplicationConfiguration($app); | ||
} | ||
|
||
public function testItCanPublishConfigFilesWhenConfiguredWithDontMergeFrameworkConfiguration() | ||
{ | ||
$this->artisan('config:publish', ['--all' => true])->assertOk(); | ||
|
||
foreach ([ | ||
'app', 'auth', 'broadcasting', 'cache', 'cors', | ||
'database', 'filesystems', 'hashing', 'logging', | ||
'mail', 'queue', 'services', 'session', 'view', | ||
] as $file) { | ||
$this->assertFilenameExists("config-stubs/{$file}.php"); | ||
$this->assertStringContainsString( | ||
file_get_contents(package_path(['config', "{$file}.php"])), file_get_contents(config_path("{$file}.php")) | ||
); | ||
} | ||
|
||
$this->assertSame(config('app.providers'), ServiceProvider::defaultProviders()->toArray()); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed scenario where
app.php
configuration file is not available. Verified with tests below.