KnpLabs / packagist-api

PHP API for Packagist
MIT License
182 stars 46 forks source link

Replace Guzzle with generic PSR18 discovery #99

Open GuySartorelli opened 11 months ago

GuySartorelli commented 11 months ago

Resolves #91 Note that this would most likely need to be a new major release, as it changes the method signature of several methods which were previously relying on a Guzzle-specific options array.

This works well locally, but I have never used phpspec before and I don't know how to update the tests. Can someone with some knowledge of phpspec please give me some guidance?

All of the ClientSpec tests are failing - the error message and trace is:

Packagist/Api/Client                                                              
  29  - it search for packages
      exception [err:TypeError("Double\GuzzleHttp\Client\P1::sendRequest(): Return value must be of type Psr\Http\Message\ResponseInterface, null returned")] has been thrown.
       0 vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassCreator.php(44) : eval()'d code:25
         throw new PhpSpec\Exception\ErrorException("Double\GuzzleHttp\Client\...")
       1 vendor/symfony/console/Application.php:1096
         Symfony\Component\Console\Command\Command->run()
       2 vendor/symfony/console/Application.php:324
         Symfony\Component\Console\Application->doRunCommand()
       3 vendor/phpspec/phpspec/src/PhpSpec/Console/Application.php:91
         Symfony\Component\Console\Application->doRun()
       4 vendor/phpspec/phpspec/bin/phpspec:25
         Symfony\Component\Console\Application->run()
       5 vendor/phpspec/phpspec/bin/phpspec:27
         {closure}()
       6 vendor/bin/phpspec:120
         include("/home/gsartorelli/dump/te...")
robbieaverill commented 9 months ago

Sorry, I haven't had time to look into this again, but it is on my mind.

GuySartorelli commented 9 months ago

No worries, there's no rush.

robbieaverill commented 8 months ago

@GuySartorelli I'm not sure when I will have time to look more into this

GuySartorelli commented 8 months ago

That's fine, I don't have any real need for this - just saw an opportunity to tidy up this package's dependencies and figured I'd give it a go. If I get a chance in the next few weeks I'll try learn how mocking works with this testing library.