Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Only use SystemContext #148

Open
tophsic opened this issue Dec 1, 2015 · 5 comments
Open

Only use SystemContext #148

tophsic opened this issue Dec 1, 2015 · 5 comments

Comments

@tophsic
Copy link
Contributor

tophsic commented Dec 1, 2015

To test command lines tool, I do not need http_call services required in Extension::load method.

Do you think it is a good idea to add a parameter to allow to skip http_call loading?

PR is coming if so.

@sanpii
Copy link
Member

sanpii commented Dec 1, 2015

It’s just a service declaration. If you don’t load a class needs it, no instance is created.

@tophsic
Copy link
Contributor Author

tophsic commented Dec 1, 2015

I should have begin by that

My composer file:

{
    "name": "my/project",
    "type": "project",
    "require": {
        "php": ">=5.4"
    },
    "require-dev": {
        "behatch/contexts": "^2.3"
    }
}

My Behat configuration:

default:
    suites:
        core:
            paths:
                - %paths.base%/features
            contexts:
                - FeatureContext
                - behatch:system:
                    root: "."

    extensions:
        Sanpi\Behatch\Extension: ~
# vendor/bin/behat

  [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]                   
  The service "behatch.http_call.listener" has a dependency on a non-existent service "mink".  

@tophsic
Copy link
Contributor Author

tophsic commented Dec 1, 2015

Fool I am

default:
    suites:
        core:
            paths:
                - %paths.base%/features
            contexts:
                - FeatureContext
                - Sanpi\Behatch\Context\SystemContext

is working

@sanpii
Copy link
Member

sanpii commented Dec 1, 2015

Ok, we can load the http_call service only if the mink service exist. What do you think?

@tophsic
Copy link
Contributor Author

tophsic commented Dec 1, 2015

Sure.

For now, only SystemContext is able to work without http_call service, isn'it?

It would be great to split JsonContext to be able to anlayse Json in a local file for example. It is another story.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants