Skip to content

Commit

Permalink
Update changelog & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jdreesen committed Mar 11, 2024
1 parent 6a3e03c commit c87c5de
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
11 changes: 5 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Changelog

## v0.11.1

## v0.12.0
### Features
- Dynamically configurable test kernel with which you can register bundles, load configurations,
configure extensions, and register compiler passes for each test.

## v0.11.1
### Features
- Support for Pimcore 11.

## v0.11.0

### Breaking Changes:

- `Neusta\Pimcore\TestingFramework\Pimcore\BootstrapPimcore::bootstrap()` now expects named arguments.<br>
If you pass the application environment as a parameter, you now have to prefix it with: `APP_ENV:`:
```diff
Expand All @@ -22,9 +23,7 @@
- The `WithoutAdminMode` trait was removed.

### Bugfixes:

- Reset admin mode to previous state after each test class when using `WithAdminMode` trait.

### Changes:

- Drop support for Pimcore `<10.5` and PHP `<8.1`.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ To enable it again, you can use the `WithAdminMode` trait.
- `WithInheritedValues`
- `WithoutInheritedValues`
### Integration tests with configurable Kernel
The `TestKernel` can be configured dynamically for each test.
This is useful if different configurations or dependent bundles are to be tested.
To do this, your test class must inherit from `ConfigurableKernelTestCase`:
```php
use Neusta\Pimcore\TestingFramework\Kernel\TestKernel;
use Neusta\Pimcore\TestingFramework\Test\ConfigurableKernelTestCase;
class BundleInitializationTest extends ConfigurableKernelTestCase
{
public function test_bundle_with_different_configuration(): void
{
// Boot the kernel with a config closure
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
// Add some other bundles we depend on
$kernel->addTestBundle(OtherBundle::class);
// Add some configuration
$kernel->addTestConfig(__DIR__.'/config.yaml');
// Configure some extension
$kernel->addTestExtensionConfig('my_bundle', ['some_config' => true]);
// Add some compiler pass
$kernel->addTestCompilerPass(new MyBundleCompilerPass());
}]);
}
}
```
### Integration Tests With a Database
If you write integration tests that use the database, we've got you covered too.
Expand Down

0 comments on commit c87c5de

Please sign in to comment.