Code Monkey home page Code Monkey logo

Comments (8)

sanpii avatar sanpii commented on June 21, 2024

Scrutinizer would be probably happy too if the rest context is rewritten: https://scrutinizer-ci.com/g/Behatch/contexts/issues/master/files/src/Context/RestContext.php?selectedLabels[0]=9&orderField=path&order=asc

from contexts.

sanpii avatar sanpii commented on June 21, 2024

I just push a new branch browser-kit fixed this issue. Feedback welcome 😃

from contexts.

richstandbrook avatar richstandbrook commented on June 21, 2024

@sanpii I've just pulled the browser-kit branch and run the tests and I'm getting the same error.

Call to undefined method Symfony\Component\HttpKernel\Client::setHeader()

from contexts.

richstandbrook avatar richstandbrook commented on June 21, 2024

Any thoughts on this? I am using it along with a https://github.com/laracasts/Behat-Laravel-Extension could there be a conflict? Perhaps I'm not configuring be behatch properly?

default:

  extensions:
    Laracasts\Behat: ~
    Sanpi\Behatch\Extension: ~
    Behat\MinkExtension:
      show_cmd: "/Applications/Safari.app/Contents/MacOS/Safari %s"
      default_session: laravel
      laravel: ~

  suites:
    default:
      contexts:
        - FeatureContext
        - Behat\MinkExtension\Context\MinkContext
        - behatch:json
        - behatch:rest

from contexts.

richstandbrook avatar richstandbrook commented on June 21, 2024

Has anyone been able to set headers with the REST context here? I could really use it, I've tried to have a look myself but I can't figure out how to fix it myself.

from contexts.

fsevestre avatar fsevestre commented on June 21, 2024

@sanpii

Like @koorb, we are not able to set headers with the I add :name header equal to :value step.

I tried the browser-kit branch too and I have this issue:

PHP Fatal error:  Call to undefined method Symfony\Bundle\FrameworkBundle\Client::setHeader() in /home/fsevestre/workspace/broadcast-api/broadcast-api/vendor/behatch/contexts/src/HttpCall/Request/Goutte.php on line 64

Symfony 2.7

My behat.yml:

default:
    calls:
        error_reporting: 16383 # E_ALL & ~E_USER_DREPRECATED
    suites:
        default:
            type: symfony_bundle
            bundle: 'AppBundle'
            paths: [ %paths.base%/src/AppBundle/Tests/Features ]
            contexts:
                - AppBundle\Tests\Features\Context\FeatureContext: { doctrine: "@doctrine" }
                - AppBundle\Tests\Features\Context\JsonContext
                - AppBundle\Tests\Features\Context\SecurityContext: { container: "@service_container" }
                - Behat\MinkExtension\Context\MinkContext
                - Knp\FriendlyContexts\Context\AliceContext
                - Sanpi\Behatch\Context\RestContext
    extensions:
        Behat\Symfony2Extension:
            kernel:
              env: "test"
              debug: "true"
        Behat\MinkExtension:
            base_url: "http://broadcast-api.dev"
            sessions:
                default:
                    symfony2: ~
        Sanpi\Behatch\Extension: ~
        Knp\FriendlyContexts\Extension:
            alice:
                fixtures:
                    ...
                dependencies: ~

from contexts.

teohhanhui avatar teohhanhui commented on June 21, 2024

@koorb @fsevestre The browser-kit branch is outdated as far as I can tell. My PR should work.

from contexts.

fsevestre avatar fsevestre commented on June 21, 2024

👍 Thanks @teohhanhui, I tried your PR and the I add :name header equal to :value step is now working as expected on my app (I can finally remove all my TODOs :))

from contexts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.