-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from MacPaw/feat/rewriteAsBundle
feat: rewrite as bundle
- Loading branch information
Showing
15 changed files
with
130 additions
and
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
/composer.lock | ||
/build/ | ||
/.phpunit.result.cache | ||
|
||
/node_modules/ | ||
package-lock.json | ||
/.idea/ | ||
/package-lock.json |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,4 +40,5 @@ | |
<rule ref="Squiz.Arrays.ArrayBracketSpacing"/> | ||
|
||
<file>src/</file> | ||
<file>tests/</file> | ||
</ruleset> |
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BehatMessengerContext; | ||
|
||
use Symfony\Component\HttpKernel\Bundle\Bundle; | ||
|
||
class BehatMessengerContextBundle extends Bundle | ||
{ | ||
} |
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.
24 changes: 24 additions & 0 deletions
24
src/DependencyInjection/BehatMessengerContextExtension.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,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BehatMessengerContext\DependencyInjection; | ||
|
||
use Symfony\Component\Config\FileLocator; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Extension\Extension; | ||
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | ||
|
||
class BehatMessengerContextExtension extends Extension | ||
{ | ||
/** | ||
* @param array<array> $configs | ||
* | ||
* {@inheritdoc} | ||
*/ | ||
public function load(array $configs, ContainerBuilder $container): void | ||
{ | ||
$loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); | ||
$loader->load('messenger_context.xml'); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BehatMessengerContext\DependencyInjection; | ||
|
||
use Symfony\Component\Config\Definition\Builder\TreeBuilder; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
|
||
class Configuration implements ConfigurationInterface | ||
{ | ||
public function getConfigTreeBuilder(): TreeBuilder | ||
{ | ||
return new TreeBuilder('behat_messenger_context'); | ||
} | ||
} |
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<container xmlns="http://symfony.com/schema/dic/services" | ||
xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance" | ||
xsd:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd"> | ||
|
||
<services> | ||
<service public="true" autowire="true" id="BehatMessengerContext\Context\MessengerContext" class="BehatMessengerContext\Context\MessengerContext"> | ||
<argument key="$container" type="service" id="test.service_container"/> | ||
</service> | ||
</services> | ||
</container> |
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
tests/DependencyInjection/BehatMessengerContextExtensionTest.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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DependencyInjection; | ||
|
||
use BehatMessengerContext\Context\MessengerContext; | ||
use BehatMessengerContext\DependencyInjection\BehatMessengerContextExtension; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
use Symfony\Component\DependencyInjection\Extension\Extension; | ||
|
||
class BehatMessengerContextExtensionTest extends TestCase | ||
{ | ||
public function testHasServices(): void | ||
{ | ||
$extension = new BehatMessengerContextExtension(); | ||
$container = new ContainerBuilder(); | ||
|
||
$this->assertInstanceOf(Extension::class, $extension); | ||
|
||
$extension->load([], $container); | ||
|
||
$this->assertTrue($container->has(MessengerContext::class)); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DependencyInjection; | ||
|
||
use BehatMessengerContext\DependencyInjection\Configuration; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Config\Definition\ConfigurationInterface; | ||
use Symfony\Component\Config\Definition\Processor; | ||
|
||
class ConfigurationTest extends TestCase | ||
{ | ||
public function testConfiguration(): void | ||
{ | ||
$processor = new Processor(); | ||
$configuration = new Configuration(); | ||
|
||
$this->assertInstanceOf(ConfigurationInterface::class, $configuration); | ||
|
||
$configs = $processor->processConfiguration($configuration, []); | ||
|
||
$this->assertSame([], $configs); | ||
} | ||
} |