Codeception raise fatal error with Laravel 4 and Guzzle HTTP - php

I'm using Laravel 4.2.* and Codeception 2.* for the record.
When I try to create an acceptance test with Laravel4 module I use this configuration
## Other code
config:
Laravel4:
# This file is in app/tests/acceptance.suite.yml
start: '/../../bootstrap/start.php'
cleanup: true
## Other code
And it works, I mean I can build it. But when I run codecept run it fails and raise a fatal error.
Fatal error: Cannot redeclare GuzzleHttp\Stream\create() (previously
declared in
phar:///usr/local/Cellar/codeception/2.0.0/libexec/codecept-2.0.0.phar/vendor/guzzlehttp/streams/src/functions.php:14)
in /Users/Ludo237/Sites/l4/vendor/guzzlehttp/streams/src/functions.php
on line 14
The problem seems to be Guzzle. I'm using guzzle on my application but codeception uses it too.
How can I solve this conflict?

For a quick fix just move the global codeception install inside the project and require it trough composer...

Related

Codecept_absolute_path () not found error when executing the mftf run:test command in Magento 2.3

I have Magento 2.3 and I want to use Magento Functional Testing Framework version 2.3 but when I run the command vendor/bin/mftf run:test AdminLoginTest to run the test, the following error occurs:
==== Redirecting to Composer-installed version in vendor/codeception ====
Fatal error: Uncaught Error: Call to undefined function Codeception\Lib\codecept_absolute_path() in /Users/hanhan/Deskto
p/workspace/magento2/vendor/codeception/codeception/src/Codeception/Lib/ParamsLoader.php:25
In the file PramsLoader.php, codecept_absolute_path() method is invoked and it gives the error because this method is not defined
$this->paramsFile = codecept_absolute_path($paramStorage);
How can i solve this ?
I happened to encounter the same error today. It's because there is an old vendor directory in dev/tests/acceptance where previously we store composer.json file and now moved to root. Deleting dev/tests/acceptance/vendor folder resolve the fatal error.

PHPUnit: Fatal error: Cannot use PHPUnit\Framework\MockObject\Stub as Stub because the name is already in use

I did the PHPUnit installation, as explained on the PHPUnit website.
And at the end, when executing the command:
phpunit --version
Show me this error:
Fatal error: Cannot use PHPUnit\Framework\MockObject\Stub as Stub
because the name is already in use in
phar://C:/bin/phpunit.phar/phpunit-mock-objects/Builder/InvocationMocker.php
on line 16
I use last version 6.5.5.
Try other versions and the version 5.0.0 work correctly!
I have the same problem with phpunit-6.5.6 and php-7.0.0 / php-7.0.27.
I solved it with updating php-7.0.* to php-7.1.14.

Laravel fatal error: Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found

I'm trying to start using laravel php framework. I'm trying to just call the index file and I get this error message.
C:\xampp\php\php.exe C:\xampp\htdocs\tutorials\lara\application\public\index.php
Fatal error: Interface 'Illuminate\Auth\Illuminate\Contracts\Auth\Factory' not found in C:\xampp\htdocs\tutorials\lara\application\bootstrap\cache\compiled.php on line 357
Process finished with exit code 255
Can anyone shine some light on what this means?
Your Illuminate\Auth\Illuminate\Contracts\Auth\Factory may not copied in your project,that why this is happening.So you need to be
Step 1 : Remove full vendor folder
Step 2 : Run from your terminal composer install

PHPUnit does not work after upgrade to 4.0.4

This morning I updated my phpunit version from 3.7.x to 4.0.x.
I usually run PHPUnit with a bootstrap which contains
require('PHPUnit/Framework/Assert/Functions.php');
Since the update, when I try to run my phpunit tests, it fails because of the following error:
Fatal error: require(): Failed opening required 'PHPUnit/Framework/Assert/Functions.php' (include_path='.:/usr/local/lib/php/:/usr/local/share/pear/') on line 6
What can I do to resolve this?
That file changed location. It is now in src/Framework/Assert/Functions.php.

Symfony2: Fatal error: Interface 'Knp\Menu\Matcher\Voter\VoterInterface' not found in

I wanted to integrate twitter-bootstrap in my Symfony2 project and trying to make it work, I followed documentation is BootstrapBundle.
After installing all dependencies set in composer.json, i get this error:
Fatal error: Interface 'Knp\Menu\Matcher\Voter\VoterInterface' not found in /var/www/cv- editor/vendor/mopa/bootstrap-sandbox-bundle/Mopa/Bundle/BootstrapSandboxBundle/Navbar/Example/Voter/RequestVoter.php on line 12
Have you any idea ?
After debvugging, i found that there is a problem in dependencies of MopaBootsrapBundle which works with Knp-menu-bundle version 1.2

Categories