|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace spec\Knp\RadBundle\AppBundle; |
|
4
|
|
|
|
|
5
|
|
|
use PhpSpec\ObjectBehavior; |
|
6
|
|
|
use Prophecy\Argument; |
|
7
|
|
|
|
|
8
|
|
|
class ContainerExtensionSpec extends ObjectBehavior |
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* @param Knp\RadBundle\AppBundle\ConfigurableBundleInterface $bundle |
|
12
|
|
|
* @param Knp\RadBundle\AppBundle\ConfigurationFactory $configFactory |
|
13
|
|
|
* @param Knp\RadBundle\AppBundle\Configuration $config |
|
|
|
|
|
|
14
|
|
|
* @param Symfony\Component\Config\Definition\Processor $configProcessor |
|
15
|
|
|
* @param Symfony\Component\DependencyInjection\ContainerBuilder $container |
|
16
|
|
|
*/ |
|
17
|
|
|
function let($bundle, $configFactory, $configProcessor, $container) |
|
18
|
|
|
{ |
|
19
|
|
|
$this->beConstructedWith($bundle, $configFactory, $configProcessor); |
|
20
|
|
|
|
|
21
|
|
|
$bundle->getPath()->willReturn('/path/to/the/src/App'); |
|
22
|
|
|
|
|
23
|
|
|
$container->getParameter('kernel.environment')->willReturn('some_env'); |
|
24
|
|
|
} |
|
25
|
|
|
|
|
26
|
|
|
function its_getConfiguration_should_return_rad_configuration($container, $bundle, $configFactory, $config) |
|
|
|
|
|
|
27
|
|
|
{ |
|
28
|
|
|
$configFactory->createConfiguration($bundle, array('some', 'options'), $container)->willReturn($config); |
|
29
|
|
|
|
|
30
|
|
|
$this->getConfiguration(array('some', 'options'), $container)->shouldReturn($config); |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
function its_load_should_use_bundle_to_build_container($container, $bundle, $configFactory, $config, $configProcessor) |
|
|
|
|
|
|
34
|
|
|
{ |
|
35
|
|
|
$configFactory->createConfiguration(Argument::cetera())->willReturn($config); |
|
36
|
|
|
$configProcessor->processConfiguration(Argument::cetera())->willReturn(array('processed', 'options')); |
|
37
|
|
|
|
|
38
|
|
|
$bundle->buildContainer(array('processed', 'options'), $container)->shouldBeCalled(); |
|
39
|
|
|
|
|
40
|
|
|
$this->load(array('not', 'processed', 'options'), $container); |
|
41
|
|
|
} |
|
42
|
|
|
|
|
43
|
|
|
} |
|
44
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$irelandis not defined by the methodfinale(...).The most likely cause is that the parameter was changed, but the annotation was not.