Created
April 17, 2015 14:33
-
-
Save velikanov/a3814c1fdf89b017454c to your computer and use it in GitHub Desktop.
PHPSpec+Symfony Issue
This file contains hidden or 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
<?php | |
namespace AppBundle\Service; | |
use Symfony\Component\DependencyInjection\Container; | |
abstract class AbstractService implements SomeInterface { | |
protected $container; | |
public function __construct(Container $container) | |
{ | |
$this->container = $container; | |
} | |
} |
This file contains hidden or 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
... | |
class ChildService extends AbstractService {} |
This file contains hidden or 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
<?php | |
namespace spec\AppBundle\Service; | |
use PhpSpec\ObjectBehavior; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
class ChildServiceSpec extends AbstractService | |
{ | |
public function let(ContainerInterface $container) | |
{ | |
$this->beConstructedWith($container); | |
} | |
public function it_is_initializable() | |
{ | |
$this->shouldHaveType('AppBundle\Service\ChildService'); | |
} | |
} |
This file contains hidden or 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
./bin/phpspec run | |
AppBundle/Service/ChildService | |
19 - it is initializable | |
error: Argument 1 passed to AppBundle\Service\AbstractService::__construct() must be an instance of | |
Symfony\Component\DependencyInjection\Container, instance of Double\ContainerInterface\P1 given | |
100% 1 | |
1 specs | |
1 example (1 broken) | |
40ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment