Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPUnit can't find PHPUnit_Extensions_Story_TestCase. What package is missing?

Tags:

php

phpunit

I installed phpunit with all dependencies:

pear install -a phpunit/phpunit

When I run a test with a failed assertion it complains it can't find PHPUnit_Extensions_Story_TestCase.

How do I fix it?

like image 920
user19878 Avatar asked Jan 16 '23 06:01

user19878


2 Answers

The package you are missing is pear.phpunit.de/PHPUnit_Story as you can find on the pear repository page and the GitHub repository.

PS: I found this by typing the class name into google.

like image 76
igorw Avatar answered Jan 31 '23 08:01

igorw


PEAR installation has been deprecated, currently is better to use Composer for it, here is the PHPUnit installation guide just adding bellow lines

 "require-dev": {
    "phpunit/phpunit": "4.3.*",
    "phpunit/phpunit-story": "*",
    "phpunit/php-invoker": "*",
    "phpunit/dbunit": ">=1.2",
    "phpunit/phpunit-selenium": ">=1.2",
    "phpunit/phpunit-story": "*"
  }

or bettersudo composer global require 'phpunit/phpunit=4.3.*'

like image 40
Beereniche Avatar answered Jan 31 '23 08:01

Beereniche