Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
73 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; | ||
|
||
use Emoe\GuzzleBundle\DependencyInjection\Configuration; | ||
use Symfony\Component\Config\Definition\Processor; | ||
|
||
class ConfigurationTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
public function testConfiguration() | ||
{ | ||
$config = [ | ||
'emoe_guzzle' => [ | ||
'log' => [ | ||
'enabled' => true, | ||
'format' => 'test', | ||
] | ||
] | ||
]; | ||
$processor = new Processor(); | ||
$processedConfig = $processor->processConfiguration(new Configuration(), $config); | ||
$this->assertEquals($config['emoe_guzzle'], $processedConfig); | ||
} | ||
} |
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,23 @@ | ||
<?php | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection; | ||
|
||
use Emoe\GuzzleBundle\DependencyInjection\EmoeGuzzleExtension; | ||
use Prophecy\Argument; | ||
|
||
class EmoeGuzzleExtensionTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @SuppressWarnings(PHPMD.StaticAccess) | ||
*/ | ||
public function testLoad() | ||
{ | ||
$container = $this->prophesize('Symfony\Component\DependencyInjection\ContainerBuilder'); | ||
|
||
$extension = new EmoeGuzzleExtension(); | ||
$extension->load([], $container->reveal()); | ||
|
||
$container->setParameter('emoe_guzzle.log.enabled', Argument::type('bool'))->shouldHaveBeenCalled(); | ||
$container->setParameter('emoe_guzzle.log.format', Argument::type('string'))->shouldHaveBeenCalled(); | ||
} | ||
} |
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 | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Tests; | ||
|
||
use Emoe\GuzzleBundle\EmoeGuzzleBundle; | ||
use Prophecy\Argument; | ||
|
||
class EmoeGuzzleBundleTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** | ||
* @SuppressWarnings(PHPMD.StaticAccess) | ||
*/ | ||
public function testBuild() | ||
{ | ||
$container = $this->prophesize('Symfony\Component\DependencyInjection\ContainerBuilder'); | ||
$container->addCompilerPass( | ||
Argument::type('Emoe\GuzzleBundle\DependencyInjection\Compiler\ClientCompilerPass') | ||
); | ||
$container->addCompilerPass( | ||
Argument::type('Emoe\GuzzleBundle\DependencyInjection\Compiler\MonologCompilerPass') | ||
); | ||
|
||
$bundle = new EmoeGuzzleBundle(); | ||
$bundle->build($container->reveal()); | ||
} | ||
} |