1

可能重复:
Zend - 找不到 PHPUnit/framework.php

我收到一些奇怪的警告和错误,我不知道为什么,也许你也遇到了这个问题并找到了解决方案。

我正在测试一个模型

class UsersTest extends PHPUNit_Framework_TestCase {
    public function testCanCheckUser(){

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

所以这是我得到的错误:

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
4

1 回答 1

0

这是解决方案:Zend - 找不到 PHPUnit/framework.php

或者只需复制/粘贴警告所需的文件,它就可以完成这项工作

于 2012-11-16T21:38:27.780 回答