Codeception: PhpStorm run/debug error - class PHPUnit_TextUI_ResultPrinter not found

Created on 7 Mar 2018  路  3Comments  路  Source: Codeception/Codeception

What are you trying to achieve?

Run my acceptance tests trough PhpStorm using run configuration.
Tried with a new project with default configuration and a generated sample acceptance test.
I don't know if it is an issue with PhpStorm or Codeception or some dependency

What do you get instead?

Class PHPUnit_TextUI_ResultPrinter not found

Provide console output if related. Use -vvv mode for more details.

When I've selected codecept.phar in the test frameworks settings in Phpstorm I get this error:

/usr/bin/php /tmp/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction tests/acceptance/FirstCest.php

==== Redirecting to Composer-installed version in vendor/codeception ====
Codeception PHP Testing Framework v2.4.0
Powered by PHPUnit 7.0.2 by Sebastian Bergmann and contributors.

In Runner.php line 182:

Class PhpStorm_Codeception_ReportPrinter does not exist

PHP Fatal error: Uncaught RuntimeException: Command Did Not Finish Properly in /home/fester/PhpstormProjects/untitled/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php:101
Stack trace:

0 [internal function]: Codeception\Subscriber\ErrorHandler->shutdownHandler()

1 {main}

thrown in /home/fester/PhpstormProjects/untitled/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php on line 101
PHP Stack trace:
PHP 1. {main}() /tmp/ide-codeception.php:0
PHP 2. require_once() /tmp/ide-codeception.php:16
PHP 3. require() phar:///home/fester/PhpstormProjects/untitled/codecept.phar/autoload.php:12
PHP 4. Codeception\Application->run() /home/fester/PhpstormProjects/untitled/vendor/codeception/codeception/package/bin:37
PHP 5. Codeception\Application->run() /home/fester/PhpstormProjects/untitled/vendor/codeception/codeception/src/Codeception/Application.php:108

Process finished with exit code 255

When I've selected .../vendor/bin/codecept I get this error (the same in different format):

/usr/bin/php /tmp/ide-codeception.php run --report -o "reporters: report: PhpStorm_Codeception_ReportPrinter" --no-ansi --no-interaction -c /home/fester/PhpstormProjects/razvigor-tests/codeception.yml tests/acceptance/PaymentsCest.php:testPayments
PHP Fatal error: Class 'PHPUnit_TextUI_ResultPrinter' not found in /tmp/ide-codeception.php on line 22
PHP Stack trace:
PHP 1. {main}() /tmp/ide-codeception.php:0

Process finished with exit code 255

# paste output here

Provide test source code if related

// paste test

Details

  • Codeception version: 2.4
  • PHP Version: PHP 7.1.15-1+ubuntu16.04.1+deb.sury.org+2 (cli) (built: Mar 6 2018 11:10:13) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans
    with Zend OPcache v7.1.15-1+ubuntu16.04.1+deb.sury.org+2, Copyright (c) 1999-2018, by Zend Technologies

  • Operating System: Linux Mint 18.3

  • Installation type: Phar || Composer - tried both
  • List of installed packages (composer show)
    behat/gherkin v4.5.1 Gherkin DSL parser for PHP 5.3
    codeception/codeception 2.4.0 BDD-style testing framework
    codeception/notifier 0.1.0 Notification Extension for Codeception
    codeception/phpunit-wrapper 7.0.2 PHPUnit classes used by Codeception
    codeception/stub 1.0.2 Flexible Stub wrapper for PHPUnit's Mock Builder
    codeception/visualception 1.0.0 Visual regression tests for Codeception
    doctrine/instantiator 1.1.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    facebook/webdriver 1.5.0 A PHP client for Selenium WebDriver
    guzzlehttp/guzzle 6.3.0 Guzzle is a PHP HTTP client library
    guzzlehttp/promises v1.3.1 Guzzle promises library
    guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
    maknz/slack 1.7.0 A simple PHP package for sending messages to Slack, with a focus on ease of use and elegant syntax. Includes Laravel support out of the box.
    myclabs/deep-copy 1.7.0 Create deep copies (clones) of your objects
    namshi/notificator 1.0.4 A lightweight library to handle notifications the smart way.
    ngraf/slack-codeception-extension 1.4.2 This package provides an extension for Codeception to broadcast test results in Slack messenger
    phar-io/manifest 1.0.1 Component for reading phar.io manifest information from a PHP Archive (PHAR)
    phar-io/version 1.0.1 Library for handling version information and constraints
    phpdocumentor/reflection-common 1.0.1 Common reflection classes used by phpdocumentor to reflect the code structure
    phpdocumentor/reflection-docblock 4.3.0 With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBl...
    phpdocumentor/type-resolver 0.4.0
    phpspec/prophecy 1.7.5 Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage 6.0.1 Library that provides collection, processing, and rendering functionality for PHP code coverage information.
    phpunit/php-file-iterator 1.4.5 FilterIterator implementation that filters files based on a list of suffixes.
    phpunit/php-text-template 1.2.1 Simple template engine.
    phpunit/php-timer 2.0.0 Utility class for timing
    phpunit/php-token-stream 3.0.0 Wrapper around PHP's tokenizer extension.
    phpunit/phpunit 7.0.2 The PHP Unit Testing framework.
    phpunit/phpunit-mock-objects 6.0.1 Mock Object library for PHPUnit
    psr/http-message 1.0.1 Common interface for HTTP messages
    sebastian/code-unit-reverse-lookup 1.0.1 Looks up which function or method a line of code belongs to
    sebastian/comparator 2.1.3 Provides the functionality to compare PHP values for equality
    sebastian/diff 3.0.0 Diff implementation
    sebastian/environment 3.1.0 Provides functionality to handle HHVM/PHP environments
    sebastian/exporter 3.1.0 Provides the functionality to export PHP variables for visualization
    sebastian/global-state 2.0.0 Snapshotting of global state
    sebastian/object-enumerator 3.0.3 Traverses array structures and object graphs to enumerate all referenced objects
    sebastian/object-reflector 1.1.1 Allows reflection of object attributes, including inherited and non-public ones
    sebastian/recursion-context 3.0.0 Provides functionality to recursively process PHP variables
    sebastian/resource-operations 1.0.0 Provides a list of PHP built-in functions that operate on resources
    sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
    symfony/browser-kit v4.0.6 Symfony BrowserKit Component
    symfony/console v4.0.6 Symfony Console Component
    symfony/css-selector v4.0.6 Symfony CssSelector Component
    symfony/dom-crawler v4.0.6 Symfony DomCrawler Component
    symfony/event-dispatcher v4.0.6 Symfony EventDispatcher Component
    symfony/finder v4.0.6 Symfony Finder Component
    symfony/polyfill-mbstring v1.7.0 Symfony polyfill for the Mbstring extension
    symfony/process v4.0.6 Symfony Process Component
    symfony/yaml v4.0.6 Symfony Yaml Component
    theseer/tokenizer 1.1.0 A small library for converting tokenized PHP source code into XML and potentially other formats
    webmozart/assert 1.3.0 Assertions to validate method input/output with nice error messages.

  • Suite configuration: default

# paste suite config here
default
PhpStorm

All 3 comments

It is an issue of PhpStorm: https://youtrack.jetbrains.com/issue/WI-40950
Manual fix is provided in this answer: https://stackoverflow.com/a/49073046/366348

PHPStorm use their own reporter which is not compatible with PHPUnit 7.x and Codevception 2.4 setup.
I think this will be fixed soon from their side.

damn ... thank you very much!!!

P.S. The slack extension has some bug related to phpunit classes too. I guess it's the same, just wanted to leave a note here in case someone else tries to google it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joshhornby picture joshhornby  路  3Comments

DavertMik picture DavertMik  路  4Comments

gimler picture gimler  路  3Comments

Breadleyg picture Breadleyg  路  3Comments

sebastianneubert picture sebastianneubert  路  3Comments