Giter VIP home page Giter VIP logo

behapi's Issues

Tests

Add some tests. :}

Remove Twig support

It is a source of bug with the autowiring (cf Behat/Behat#1080), and also I'm not quite sure it is necessary to support it out of the box. It would also simplify all the stuff like a lot.

Using instead an extension or something along those lines would be better IMO.

Use Symfony HttpClient instead of HttpPlug ?

This would mean a refactoring of things and how the request is handled though.

Or I could keep using http-plug / psr-17/ psr-18 things, and see on the discoverable clients how to integrate symfony client (I'd rather do that actually).

Migrate to Behat 3.3

So many sexy things in it (helper container <3), and also a bunch of deprecated stuff to remove...

PHP 8.0 Support ?

Currently migrating our project on PHP 8.0, will behapi natively support it soon ?

Thank you

form data support

Support form data support for the "parameters" (will probably though another step than the current "parameter" query).

Discuss about @api tag

As discussed, we have to use the tag @api to use --api-debug and the @debug tag.

Baptiste Clavié [6:18 PM] 
je voulais avoir genre soit `@rest` soit `@api`

[6:18]  
mais je pense que je vais opter pour `@rest`

[6:18]  
(parce que `DebugRest`)

[6:18]  
ou alors `DebugApi`

[6:19]  
voir `DebugHttp` en fait, ca devrait avoir plus de sens

Remy Gazelot [6:19 PM] 
+1

Baptiste Clavié [6:20 PM] 
du coup faudrait que j'introduise un tag `@http` (edited)

Use PSR-18 / PSR-17 instead of Http-Plug

The psrs were released in last july, so maybe it'd be time to use this in Behapi.

But that maybe would introduce bc breaks, so it will be for 0.13 (or 1.0 ?)

Use a real printer for debug

Instead of forcing a format (eg through behapi: { debug: { formatter: 'pretty' } } ), we should use the current printer to print the data correctly, so that it works for all outputs.

README

Add a README (How tos, where does this project comes from, .... etc)

Support namespaces Twig services

Currently, only not-namespaced twig classes are supported (Twig_Environement and not Twig\Environment). Need to fix that... maybe.

Maybe, because I doubt that namespaced twig classes are used, especially as they are only aliases extending the original twig classes.

Use EventDispatcher to add information to requests

Adding an event dispatcher could be useful, if we need to (e.g) add some headers, ... and so on, rather than having to listen to a @BeforeStep which may not be quite efficient.

Firing some events here and there could be useful.

Debug mode do not works as expected

Currently using the debug mode with --api-debug nor @debug does not works as expected.
The debug context is loaded via behat.yml

default:                                                                         
  formatters:                                                                    
    progress: true                                                               
  suites:                                                                        
    main:                                                                        
      paths: [%paths.base%/features/specs]                                       
      services: "@behapi.container"                                              
                                                                                 
      contexts:                                                                  
        - Behapi\Context\Rest:                                                   
          - "@http.client"                                                       
          - "@http.stream_factory"                                               
          - "@http.message_factory"                                              
          - "@http.history"                                                      
                                                                                 
        - Behapi\Context\Json:                                                   
          - "@http.history"                                                      
                                                                                 
        - Behapi\Context\DebugRest:                                              
          - "@debug"                                                             
          - "@http.history"                                                      
                                                                                 
  extensions:                                                                    
    Behapi\Extension\Behapi:                                                     
      base_url: 'http://nginx/app_dev.php'  

But the output seems not good:

/srv $  ./vendor/bin/behat features/specs/api/decoder.feature:18 --api-debug 
@rest
Feature: Test data request decoder using a debug endoint
  In order to test the data decoder
  As a api user
  I need to be able to send data

  Scenario: send json data via GET should be ignored        # features/specs/api/decoder.feature:18
    When I create a "GET" request to "/debug/api/echo-data" # Behapi\Context\Rest::createARequest()
    And I set the following body:                           # Behapi\Context\Rest::setTheBody()
      """
       {"foo": "bar"}
      """
    And I send the request                                  # Behapi\Context\Rest::sendRequest()
    Then the status code should be 200                      # Behapi\Context\Rest::statusCodeShouldBe()
    And the response should be a valid json response        # Behapi\Context\Json::responseIsValidjson()
    And in the json, "data.foo" should be equal to "bar"    # Behapi\Context\Json::theJsonPathShouldBeEqualTo()
      PropertyAccessor requires a graph of objects or arrays to operate on, but it found type "NULL" while trying to traverse path "data.foo" at property "foo". (Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException)

--- Failed scenarios:

    features/specs/api/decoder.feature:18

1 scenario (1 failed)
6 steps (5 passed, 1 failed)
0m0.14s (9.17Mb)

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.