1

Possible Duplicate:
Zend - cannot find PHPUnit/framework.php

I'm getting some strange warnings and errors, and I don't know why, maybe you had this problem too and found a solution.

I'm testing a model

class UsersTest extends PHPUNit_Framework_TestCase {
    public function testCanCheckUser(){

        $user = Users::getInstance();
        $userNotFound = true;
        $this->assertFalse($userNotFound);
    } }

So here is the error that I'm getting:

PHP Strict Standards:  Creating default object from empty value in C:\Users\Lili
\Dropbox\www\_playground\myApp\application\Bootstrap.php on line 207
PHPUnit 3.7.9 by Sebastian Bergmann.

Configuration read from C:\Users\Lili\Dropbox\www\_playground\myApp\tests\phpuni
t.xml

←[41;37mF←[0m

Time: 0 seconds, Memory: 5.50Mb

There was 1 failure:

1) UsersTest::testCanCheckUser
PHP Warning:  include_once(PHP\Invoker.php): failed to open stream: No such file
 or directory in C:\Users\Lili\Dropbox\www\_playground\myApp\Zend\Loader.php on
line 146
PHP Warning:  include_once(): Failed opening 'PHP\Invoker.php' for inclusion (in
clude_path='C:\xampp\php\PEAR\PHPUnit;C:\Users\Lili\Dropbox\www\_playground\opun
y\application/../library;C:\Users\Lili\Dropbox\www\_playground\myApp\application
;C:\Users\Lili\Dropbox\www\_playground\myApp\application/models;C:\Users\Lili\Dr
opbox\www\_playground\myApp\application/../;.;C:\xampp\php\PEAR') in C:\Users\Li
li\Dropbox\www\_playground\myApp\Zend\Loader.php on line 146
PHP Warning:  include_once(PHPUnit\Extensions\SeleniumTestCase.php): failed to o
pen stream: No such file or directory in C:\Users\Lili\Dropbox\www\_playground\o
puny\Zend\Loader.php on line 146
PHP Warning:  include_once(): Failed opening 'PHPUnit\Extensions\SeleniumTestCas
e.php' for inclusion (include_path='C:\xampp\php\PEAR\PHPUnit;C:\Users\Lili\Drop
box\www\_playground\myApp\application/../library;C:\Users\Lili\Dropbox\www\_play
ground\myApp\application;C:\Users\Lili\Dropbox\www\_playground\myApp\application
/models;C:\Users\Lili\Dropbox\www\_playground\myApp\application/../;.;C:\xampp\p
hp\PEAR') in C:\Users\Lili\Dropbox\www\_playground\myApp\Zend\Loader.php on line
 146
PHP Warning:  include_once(PHPUnit\Extensions\Story\TestCase.php): failed to ope
n stream: No such file or directory in C:\Users\Lili\Dropbox\www\_playground\opu
ny\Zend\Loader.php on line 146
PHP Warning:  include_once(): Failed opening 'PHPUnit\Extensions\Story\TestCase.
php' for inclusion (include_path='C:\xampp\php\PEAR\PHPUnit;C:\Users\Lili\Dropbo
x\www\_playground\myApp\application/../library;C:\Users\Lili\Dropbox\www\_playgr
ound\myApp\application;C:\Users\Lili\Dropbox\www\_playground\myApp\application/m
odels;C:\Users\Lili\Dropbox\www\_playground\myApp\application/../;.;C:\xampp\php
\PEAR') in C:\Users\Lili\Dropbox\www\_playground\myApp\Zend\Loader.php on line 1
46
Failed asserting that true is false.

C:\Users\Lili\Dropbox\www\_playground\myApp\tests\application\models\UsersTest.p
hp:13

←[37;41m←[2KFAILURES!
←[0m←[37;41m←[2KTests: 1, Assertions: 1, Failures: 1.
←[0m←[2K
2
  • Is that full content of your test or you strip something? I don't see any line where you initialize Zend Framework. If that is the case have a look here binarypreach.blogspot.co.uk/2012/09/… Commented Nov 16, 2012 at 21:36
  • I ran into same problem, and this question in not a dublicate and the answer is wrong. Since PHPUnit since 3.5 split up to different pear modules you must install additional pear phpunit denendencies, like PHP_Invoker, "pear install phpunit/PHP_Invoker". That solved the issue for me and should solve for TS Commented May 26, 2013 at 8:52

1 Answer 1

0

Here is the solution: Zend - cannot find PHPUnit/framework.php

Or Just copy/paste the files required by the warnings and it will do the job

Sign up to request clarification or add additional context in comments.

1 Comment

If you have an additional answer to the duplicate question, please place your answer there. Also it makes sense to make it more prominent with this question to say it is about the existing QA material. - Also you might want to disable colors so that the output in your question does not have the noise of the ANSI color codes.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.