Details
-
Bug
-
Resolution: Fixed
-
Blocker
-
5.4-dev
Description
For the command testing when running the actual command this error is thrown:
You cannot create a service ("request") of an inactive scope ("request").
(here BehatBundle/Context/CommandContext )
To test this it needs BehatBundle#1 (it was done on top of that) plus the above commit
Add following to behat.yml:
command: context: class: EzSystems\BehatBundle\Context\CommandContext filters: tags: '@commandFeature'
Then just run:
$ php bin/behat -p command
Stack trace:
You cannot create a service ("request") of an inactive scope ("request"). #0 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(319): ezpublishBehatDebugProjectContainer->getRequestService() #1 /var/www/html/dev/behat/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Legacy/Kernel/Loader.php(152): Symfony\Component\DependencyInjection\Container->get('request') #2 /var/www/html/dev/behat/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/MVC/Legacy/Kernel/Loader.php(112): eZ\Publish\Core\MVC\Legacy\Kernel\{closure}() #3 /var/www/html/dev/behat/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishLegacyBundle/Command/LegacyEmbedScriptCommand.php(73): eZ\Publish\Core\MVC\Legacy\Kernel\{closure}() #4 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php(244): eZ\Bundle\EzPublishLegacyBundle\Command\LegacyEmbedScriptCommand->execute(Object(Symfony\Component\Console\Input\StringInput), Object(Symfony\Component\Console\Output\StreamOutput)) #5 /var/www/html/dev/behat/vendor/ezsystems/behatbundle/EzSystems/BehatBundle/Context/CommandContext.php(165): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\StringInput), Object(Symfony\Component\Console\Output\StreamOutput)) #6 [internal function]: EzSystems\BehatBundle\Context\CommandContext->iRunACommand2('ezpublish:legac...') #7 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Definition/Annotation/Definition.php(155): call_user_func_array(Array, Array) #8 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php(157): Behat\Behat\Definition\Annotation\Definition->run(Object(EzSystems\BehatBundle\Context\CommandContext)) #9 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php(126): Behat\Behat\Tester\StepTester->executeStepDefinition(Object(Behat\Gherkin\Node\StepNode), Object(Behat\Behat\Definition\Annotation\When)) #10 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/StepTester.php(95): Behat\Behat\Tester\StepTester->executeStep(Object(Behat\Gherkin\Node\StepNode)) #11 /var/www/html/dev/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php(42): Behat\Behat\Tester\StepTester->visit(Object(Behat\Gherkin\Node\StepNode)) #12 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php(148): Behat\Gherkin\Node\AbstractNode->accept(Object(Behat\Behat\Tester\StepTester)) #13 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/ScenarioTester.php(87): Behat\Behat\Tester\ScenarioTester->visitStep(Object(Behat\Gherkin\Node\StepNode), Object(Behat\Gherkin\Node\ScenarioNode), Object(EzSystems\BehatBundle\Context\CommandContext), Array, false) #14 /var/www/html/dev/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php(42): Behat\Behat\Tester\ScenarioTester->visit(Object(Behat\Gherkin\Node\ScenarioNode)) #15 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Tester/FeatureTester.php(88): Behat\Gherkin\Node\AbstractNode->accept(Object(Behat\Behat\Tester\ScenarioTester)) #16 /var/www/html/dev/behat/vendor/behat/gherkin/src/Behat/Gherkin/Node/AbstractNode.php(42): Behat\Behat\Tester\FeatureTester->visit(Object(Behat\Gherkin\Node\FeatureNode)) #17 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php(150): Behat\Gherkin\Node\AbstractNode->accept(Object(Behat\Behat\Tester\FeatureTester)) #18 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Console/Command/BehatCommand.php(128): Behat\Behat\Console\Command\BehatCommand->runFeatures(Object(Behat\Gherkin\Gherkin)) #19 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php(244): Behat\Behat\Console\Command\BehatCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #20 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(891): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #21 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(191): Symfony\Component\Console\Application->doRunCommand(Object(Behat\Behat\Console\Command\BehatCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #22 /var/www/html/dev/behat/vendor/behat/behat/src/Behat/Behat/Console/BehatApplication.php(68): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #23 /var/www/html/dev/behat/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(121): Behat\Behat\Console\BehatApplication->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #24 /var/www/html/dev/behat/vendor/behat/behat/bin/behat(32): Symfony\Component\Console\Application->run() #25 {main}
Attachments
Issue Links
- relates to
-
EZP-22225 Publishing content in a symfony command throws InactiveScopeException
- Closed