Komodo IDE phpunit guzzle error

#!/usr/bin/env php
PHPUnit 5.4.6 by Sebastian Bergmann and contributors.
Fatal error: Class ‘GuzzleHttp\Tests\Psr7\HasToString’ not found in
C:\Temp\phpunit1\vendor\guzzlehttp\psr7\tests\FunctionsTest.php on line 389

This error appears when I run my test plan.

If I run ‘phpunit tests’ from the command line from the same working folder set in my test plan, it works as expected.

If I remove the guzzle component, the test plan works as expected.

Any help is appreciated!

What version of Komodo?


Try adding C:\Temp\phpunit1\vendor\ to Preferences > Languages > PHP > PHP Directories.

Note that the current unit testing feature will be completely replaced in Komodo IDE 10.2, which you can preview today (it’s an alpha pre-release): Komodo 10.2 Pre-Release Now Available

I got the same result after adding the directory. I closed and reopened Komodo, just in case it was needed for the change to take effect as well.

I’ve not had a chance to test the 10.2 alpha yet. It looks like a good update.

Where is GuzzleHttp\Tests\Psr7\HasToString located?

It could be PSR autoloading.

It works fine using the alpha.

I did have to go to custom first because of the --teamcity hardcoded into the command phpunit if you select the phpunit framework.

What formatter is used for PHPUnit output? I thought that by default it should be TAP so Komodo shouldn’t pass --teamcity option to the phpunit command.

Where is GuzzleHttp\Tests\Psr7\HasToString located?

It doesn’t exist.

Which then gave me the idea, why are tests other than mine running to begin with?

I removed vendor/guzzlehttp/psr7/tests and it now runs fine in 10.1.4. I’m guessing the current version is very aggressive in find tests to run, while the alpha is not.

Yeah one of the primary reasons we dumped the old unit testing implementation is because it didn’t run tests the same way YOU would when you run them from the command line.

Unit testing in 10.2 will run your tests exactly as you would when using them from the command line, which solves a lot of problems.

1 Like