Closed jukump closed 5 years ago
The behat/common-contexts
does not require phpunit/phpunit
but the PIM does. It requires the 3.7, not the 4.0. Did you ran a composer update or install?
Thanks for the reply. I ran composer install.
In fact the master branch of behat/common-contexts
seems to require phpunit/phpunit:~4.0
: https://github.com/Behat/CommonContexts/blob/master/composer.json#L34.
I tried version 1.2.0 earlier (which does not require PHPUnit) but it didn't work if PHPUnit is autoloaded using composer because it uses require_once
to load PHPUnit: https://github.com/Behat/CommonContexts/blob/v1.2.0/Behat/CommonContexts/WebApiContext.php#L11.
With 1.2.0, when it gets to this point
require_once() .../pim-community-dev/vendor/behat/common-contexts/Behat/CommonContexts/WebApiContext.php:11
it results in
require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in .../pim-community-dev/vendor/phpunit/phpunit/PHPUnit/Autoload.php on line 45
Line 45: require_once 'File/Iterator/Autoload.php';
Looks like it's trying to load the file using Pear at this point, but installing the dependencies using Pear was not in the documentation. This could be fixed by using the master branch which uses composer autoloading, but doing so causes the issue in the original post. Any ideas how to get the tests running with either version?
Ok I understand! Anyway, the projet is abandoned, the real fix is to removed that library.
That would be the best solution. I got most of the tests working for myself by using some workarounds, but as you said, the real fix would be to drop the deprecated library.
Don't hesitate to open a PR on the master to drop "behat/common-contexts" and change a bit the Akeneo PIM WebApiContext which is the only one using this library.
Hi @jukump! Did you still have this issue? Regards,
Hi! I close this issue. Feel free to reopen it if you still have an error. Regards,
akeneo-pim-system-info_2016-06-28_12-27.txt
I set up Behat as described here: http://docs.akeneo.com/1.4/contributing/behat.html
Setting up the test environment worked, but when I run
./bin/behat features/filter/identifier.feature
the test crashes to the following error:
Line 54:
assertEquals($expected, $actual);
This only seems to be an issue with some tests. Other tests also crash when assertEquals() or assertTrue() is called, but for example this works fine:
./bin/behat features/product-group/create_product_group.feature
The 1.2.0 version of behat/common-contexts doesn't seem to be compatible with PHPUnit installed via composer, so I'm using behat/common-contexts:dev-master, which requires phpunit/phpunit:~4.0. Other dependencies are the same as in the docs.