Skip to content
This repository was archived by the owner on May 27, 2023. It is now read-only.

PHP Fatal error: Class 'SebastianBergmann\Comparator\Factory' not found in lib/EcomDev/PHPUnit/AbstractConstraint.php on line 153 #224

Closed
razbakov opened this issue Oct 2, 2014 · 2 comments

Comments

@razbakov
Copy link

razbakov commented Oct 2, 2014

I tried to install it using composer,
I have found some workarounds,
but now I have another error:

PHP Fatal error:  Class 'SebastianBergmann\Comparator\Factory' not found in lib/EcomDev/PHPUnit/AbstractConstraint.php on line 153

Here is what I do:

  1. add to composer json require section:
"firegento/psr0autoloader": "*", // maybe can solve SebastianBergmann\Comparator\Factory
"ecomdev/ecomdev_phpunit": "dev-dev",
"mikey179/vfsStream": "1.4.*"
  1. run composer update

  2. copy vfsStream manually, because of vfsStream is not copied to lib directory magento-hackathon/magento-composer-installer#128
    cp -rf vendor/mikey179/vfsStream/src lib/vfsStream/

  3. add to app/code/community/EcomDev/PHPUnit/bootstrap.php to avoid Cookies already sent:

ini_set('session.use_cookies', 0);
ini_set('session.cache_limiter', '');
  1. add phpunit.xml.dist (copy from EcomDev repo)

  2. install ecomdev:

cd shell 
php ecomdev-phpunit.php -a magento-config --db-name $DB_NAME --base-url http://your.magento.url/
php ecomdev-phpunit.php -a fix-autoloader
  1. run phpunit
@Flyingmana
Copy link
Contributor

could you add an include for the vendor/autoload.php to the bootstrap.php?
The last time I tried this there was only one problem, which should be fixed now.

@razbakov
Copy link
Author

razbakov commented Oct 2, 2014

ok, the problem was old version of phpunit
now i downloaded latest 4.2.6 from website and it works

@razbakov razbakov closed this as completed Oct 2, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants