Skip to content
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

docs & some boyscouting #18

Merged
merged 8 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/advanced-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ There are a couple of commands at your disposal:

`artisan bundle:build` Scan all your build_paths configured in `config/bundle.php` & compile all your imports.

You may configure what paths are scanned by publishing the Bundle config file and updating the `build_paths` array. Note this config option accepts an array of paths.
You can configure what paths are scanned by publishing the Bundle config file and updating the `build_paths` array. Note this config option accepts an array of paths.

```php
'build_paths' => [
Expand All @@ -184,12 +184,10 @@ You may configure what paths are scanned by publishing the Bundle config file an

## Testing fake

When writing Unit or Feature tests in your application you don't need Bundle to process & serve your imports.

Simply use the BundleManager fake in your test setup. Perfect for when you're asserting on responses with feature tests.
When writing Unit or Feature tests in your application you don't need Bundle to process & serve your imports. You may use the BundleManager fake in your test setup. When testing responses your imports won't be bundled.

```php
BundleManager::fake();
```

When you'd like to use Dusk for browser testing you need to run Bundle in order for your tests not to blow up. Simply don't fake the BundleManager in your DuskTestCase.
If you'd like to use Dusk for browser testing you probably need do to run Bundle. You can assert on any script that depends on a Bundle import. In fact, that's how most of Bundle itself is tested internally.
2 changes: 0 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class ServiceProvider extends BaseServiceProvider
{
public function boot(): void
{
$this->mergeConfigFrom(__DIR__ . '/../config/bundle.php', 'bundle');

// Only when using locally
if (! $this->app->environment(['local', 'testing'])) {

Expand Down
5 changes: 5 additions & 0 deletions tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ protected function setUp(): void

$this->artisan('view:clear');
$this->artisan('bundle:clear');

// Workaround Testbench Dusk issue dropping registered config (since v9)
config([
'bundle' => require __DIR__ . '/../config/bundle.php',
]);
}

protected function tearDown(): void
Expand Down
Loading