简体   繁体   English

PHPUnit类“错误”不会扩展PHPUnit_Framework_TestCase

[英]PHPUnit Class “Error” does not extend PHPUnit_Framework_TestCase

I am using Laravel 4.2 with PHP 5.6. 我在PHP 5.6中使用Laravel 4.2。 I did a composer update and now when I run my unit tests, I get the error Uncaught PHPUnit_Framework_Exception: Class "Error" does not extend PHPUnit_Framework_TestCase . 我做了一个作曲家更新,现在当我运行单元测试时,出现错误Uncaught PHPUnit_Framework_Exception: Class "Error" does not extend PHPUnit_Framework_TestCase I don't know for sure, but I believe my laravel version went from 4.2.19 to 4.2.22 我不确定,但我相信我的Laravel版本从4.2.19变为4.2.22

How do I get my unit tests to work? 如何使单元测试正常工作?

PHP 5.6.30 (cli) (built: Jan 18 2017 19:47:36)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

PHPUnit 5.7.26 by Sebastian Bergmann and contributors.

PHP Fatal error:  Uncaught PHPUnit_Framework_Exception: Class "Error" does not extend PHPUnit_Framework_TestCase.
  thrown in phar://C:/bin/phpunit-5.7.26.phar/phpunit/Framework/TestSuite.php on line 147
Fatal error: Uncaught PHPUnit_Framework_Exception: Class "Error" does not extend PHPUnit_Framework_TestCase.
  thrown in phar://C:/bin/phpunit-5.7.26.phar/phpunit/Framework/TestSuite.php on line 147

composer.json composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.2.*",
        "tecnickcom/tcpdf": "6.0.*",
        "bugsnag/bugsnag-laravel": "1.*",
        "aws/aws-sdk-php": "2.*",
        "pda/pheanstalk": "2.*",
        "mockery/mockery": "0.*"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ],
        "psr-0": {
            "idweb": "app"
        }
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

composer show -i 作曲家表演-i

aws/aws-sdk-php               2.8.31  AWS SDK for PHP - Use Amazon Web Services in your PHP project
bugsnag/bugsnag               v2.9.2  Official Bugsnag notifier for PHP applications.
bugsnag/bugsnag-laravel       v1.7.0  Official Bugsnag notifier for Laravel applications.
classpreloader/classpreloader 1.0.2   Helps class loading performance by generating a single PHP file containing...
d11wtq/boris                  v1.0.8 
filp/whoops                   1.1.10  php error handling for cool kids
guzzle/guzzle                 v3.9.3  PHP HTTP client. This library is deprecated in favor of https://packagist....
hamcrest/hamcrest-php         v1.2.2  This is the PHP port of Hamcrest Matchers
ircmaxell/password-compat     v1.0.4  A compatibility library for the proposed simplified password hashing algor...
jeremeamia/SuperClosure       1.0.2   Doing interesting things with closures like serialization.
laravel/framework             v4.2.22 The Laravel Framework.
mockery/mockery               0.9.9   Mockery is a simple yet flexible PHP mock object framework for use in unit...
monolog/monolog               1.23.0  Sends your logs to files, sockets, inboxes, databases and various web serv...
nesbot/carbon                 1.22.1  A simple API extension for DateTime.
nikic/php-parser              v0.9.5  A PHP parser written in PHP
paragonie/random_compat       v1.4.2  PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
patchwork/utf8                v1.3.1  Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP
pda/pheanstalk                v2.1.1  PHP client for beanstalkd queue
phpseclib/phpseclib           0.3.10  PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, ...
predis/predis                 v0.8.7  Flexible and feature-complete PHP client library for Redis
psr/log                       1.0.2   Common interface for logging libraries
stack/builder                 v1.0.5  Builder for stack middlewares based on HttpKernelInterface.
swiftmailer/swiftmailer       v5.4.8  Swiftmailer, free feature-rich PHP mailer
symfony/browser-kit           v2.7.39 Symfony BrowserKit Component
symfony/console               v2.7.39 Symfony Console Component
symfony/css-selector          v2.7.39 Symfony CssSelector Component
symfony/debug                 v2.7.39 Symfony Debug Component
symfony/dom-crawler           v2.7.39 Symfony DomCrawler Component
symfony/event-dispatcher      v2.8.32 Symfony EventDispatcher Component
symfony/filesystem            v2.8.32 Symfony Filesystem Component
symfony/finder                v2.7.39 Symfony Finder Component
symfony/http-foundation       v2.7.39 Symfony HttpFoundation Component
symfony/http-kernel           v2.7.39 Symfony HttpKernel Component
symfony/polyfill-mbstring     v1.6.0  Symfony polyfill for the Mbstring extension
symfony/process               v2.7.39 Symfony Process Component
symfony/routing               v2.7.39 Symfony Routing Component
symfony/security-core         v2.7.39 Symfony Security Component - Core Library
symfony/translation           v2.7.39 Symfony Translation Component
tecnickcom/tcpdf              6.0.099 TCPDF is a PHP class for generating PDF documents and barcodes.

尝试更新phpunit软件包,并在phpunit最新版本的TestCase类而不是PHPUnit_Framework_TestCase中扩展类Tests \\ TestCase。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 phpunit 8 和 PHPUnit_Framework_TestCase - phpunit 8 and PHPUnit_Framework_TestCase PHP 致命错误:找不到类“PHPUnit_Framework_TestCase” - PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found Symfony:致命错误:找不到类'PHPUnit_Framework_TestCase' - Symfony: Fatal error: Class 'PHPUnit_Framework_TestCase' not found in 如何使用此文件PHPunit测试“扩展PHPUnit_Framework_TestCase” - How to use this File PHPunit test “extend PHPUnit_Framework_TestCase” 致命错误:找不到类'PHPUnit_Framework_TestCase' - Fatal error: Class 'PHPUnit_Framework_TestCase' not found 为什么,致命错误:在...中找不到类“PHPUnit_Framework_TestCase”? - Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...? PHPUnit-如何在PHPUnit_Framework_TestCase中实例化我的pdo类? - PHPUnit - How to instantiate my pdo class in PHPUnit_Framework_TestCase? PHPUnit CodeIgniter生成夹具PHP致命错误:未找到类“ PHPUnit_Framework_TestCase” - PHPUnit CodeIgniter Generate Fixtures PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found 使用\\ PHPUnit_Framework_TestCase或.. \\ TestCase - Use \PHPUnit_Framework_TestCase or ..\TestCase 致命错误:在第24行的dbunit \\ PHPUnit \\ Extensions \\ Database \\ TestCase.php中找不到类“ PHPUnit_Framework_TestCase” - Fatal error: Class 'PHPUnit_Framework_TestCase' not found in dbunit\PHPUnit\Extensions\Database\TestCase.php on line 24
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM