-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow kernel configuration via data provider (#12)
- Loading branch information
Showing
8 changed files
with
163 additions
and
60 deletions.
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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neusta\Pimcore\TestingFramework\Tests\Functional; | ||
|
||
use Neusta\Pimcore\TestingFramework\Test\Attribute\ConfigureExtension; | ||
use Neusta\Pimcore\TestingFramework\Test\Attribute\RegisterBundle; | ||
use Neusta\Pimcore\TestingFramework\Test\ConfigurableKernelTestCase; | ||
use Neusta\Pimcore\TestingFramework\Tests\Fixtures\ConfigurationBundle\ConfigurationBundle; | ||
|
||
final class DataProviderTest extends ConfigurableKernelTestCase | ||
{ | ||
public function provideData(): iterable | ||
{ | ||
yield 'kernel configuration at the beginning' => [ | ||
new RegisterBundle(ConfigurationBundle::class), | ||
new ConfigureExtension('configuration', [ | ||
'foo' => 'value1', | ||
'bar' => ['value2', 'value3'], | ||
]), | ||
'value1', | ||
'value2', | ||
'value3', | ||
]; | ||
|
||
yield 'kernel configuration at the end' => [ | ||
'foo', | ||
'bar', | ||
'baz', | ||
new RegisterBundle(ConfigurationBundle::class), | ||
new ConfigureExtension('configuration', [ | ||
'foo' => 'foo', | ||
'bar' => ['bar', 'baz'], | ||
]), | ||
]; | ||
|
||
yield 'kernel configuration in between other provided data' => [ | ||
'test1', | ||
new RegisterBundle(ConfigurationBundle::class), | ||
'test2', | ||
new ConfigureExtension('configuration', [ | ||
'foo' => 'test1', | ||
'bar' => ['test2', 'test3'], | ||
]), | ||
'test3', | ||
]; | ||
} | ||
|
||
/** | ||
* @test | ||
* | ||
* @dataProvider provideData | ||
*/ | ||
public function configuration_via_data_provider(string $value1, string $value2, string $value3): void | ||
{ | ||
$container = self::getContainer(); | ||
|
||
self::assertSame($value1, $container->getParameter('configuration.foo')); | ||
self::assertSame([$value2, $value3], $container->getParameter('configuration.bar')); | ||
} | ||
} |
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