Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception [PHPUnit\Framework\Exception (8)] Undefined variable: file #6090

vadomk opened this issue Jan 14, 2021 · 2 comments · Fixed by #6094

Exception [PHPUnit\Framework\Exception (8)] Undefined variable: file #6090

vadomk opened this issue Jan 14, 2021 · 2 comments · Fixed by #6094


Copy link

vadomk commented Jan 14, 2021

What are you trying to achieve?

I just run codeception

What do you get instead?

strange exception

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

In ErrorHandler.php line 83:
  [PHPUnit\Framework\Exception (8)]  
  Undefined variable: file           

Exception trace:
  at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php:83
 Codeception\Subscriber\ErrorHandler->errorHandler() at /var/www/p2pr/vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php:377
 Codeception\Module\Symfony->getKernelClass() at /var/www/p2pr/vendor/codeception/module-symfony/src/Codeception/Module/Symfony.php:219
 Codeception\Module\Symfony->_initialize() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/SuiteManager.php:83
 Codeception\SuiteManager->initialize() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Codecept.php:204
 Codeception\Codecept->runSuite() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Codecept.php:162
 Codeception\Codecept->run() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Command/Run.php:511
 Codeception\Command\Run->runSuites() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Command/Run.php:405
 Codeception\Command\Run->execute() at /var/www/p2pr/vendor/symfony/console/Command/Command.php:255
 Symfony\Component\Console\Command\Command->run() at /var/www/p2pr/vendor/symfony/console/Application.php:971
 Symfony\Component\Console\Application->doRunCommand() at /var/www/p2pr/vendor/symfony/console/Application.php:290
 Symfony\Component\Console\Application->doRun() at /var/www/p2pr/vendor/symfony/console/Application.php:166
 Symfony\Component\Console\Application->run() at /var/www/p2pr/vendor/codeception/codeception/src/Codeception/Application.php:117
 Codeception\Application->run() at /var/www/p2pr/vendor/codeception/codeception/app.php:46
 {closure}() at /var/www/p2pr/vendor/codeception/codeception/app.php:47
 require() at /var/www/p2pr/vendor/codeception/codeception/codecept:7


  • Codeception version: 4.1.14

  • PHP Version: 7.2

  • Operating System: Ubuntu

  • Installation type: Composer

  • List of installed packages (composer show):
    alcaeus/mongo-php-adapter 1.2.0 Adapter to provide ext-mongo interface on top of mongo-php-library
    amazon/paapiphpsdk 1.0.0
    aws/aws-sdk-php 3.170.0 AWS SDK for PHP - Use Amazon Web Services in your PHP project
    babdev/pagerfanta-bundle v2.8.0 Bundle integrating Pagerfanta with Symfony
    behat/gherkin v4.6.2 Gherkin DSL parser for PHP 5.3
    behat/transliterator v1.3.0 String transliterator
    codeception/codeception 4.1.14 BDD-style testing framework
    codeception/lib-asserts 1.13.2 Assertion methods used by Codeception core and Asserts module
    codeception/lib-innerbrowser 1.3.5 Parent library for all Codeception framework modules and PhpBrowser
    codeception/module-asserts 1.3.1 Codeception module containing various assertions
    codeception/module-phpbrowser 1.0.2 Codeception module for testing web application over HTTP
    codeception/module-rest 1.2.7 REST module for Codeception
    codeception/module-symfony 1.5.0 Codeception module for Symfony framework
    codeception/phpunit-wrapper 8.1.4 PHPUnit classes used by Codeception
    codeception/stub 3.7.0 Flexible Stub wrapper for PHPUnit's Mock Builder
    composer/package-versions-deprecated Composer plugin that provides efficient querying for installed package versions (no runtime IO)
    doctrine/annotations 1.11.1 Docblock Annotations Parser
    doctrine/cache 1.10.2 PHP Doctrine Cache library is a popular cache implementation that supports many different dri...
    doctrine/collections 1.6.7 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
    doctrine/common 3.1.0 PHP Doctrine Common project is a library that provides additional functionality that other Do...
    doctrine/dbal 2.10.4 Powerful PHP database abstraction layer (DBAL) with many features for database schema introsp...
    doctrine/doctrine-bundle 2.2.2 Symfony DoctrineBundle
    doctrine/doctrine-migrations-bundle 3.0.1 Symfony DoctrineMigrationsBundle
    doctrine/event-manager 1.1.1 The Doctrine Event Manager is a simple PHP event system that was built to be used with the va...
    doctrine/inflector 2.0.3 PHP Doctrine Inflector is a small library that can perform string manipulations with regard t...
    doctrine/instantiator 1.4.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    doctrine/lexer 1.2.1 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
    doctrine/migrations 3.0.1 PHP Doctrine Migrations project offer additional functionality on top of the database abstrac...
    doctrine/mongodb-odm 2.1.2 PHP Doctrine MongoDB Object Document Mapper (ODM) provides transparent persistence for PHP ob...
    doctrine/mongodb-odm-bundle 4.2.2 Symfony2 Doctrine MongoDB Bundle
    doctrine/orm 2.8.1 Object-Relational-Mapper for PHP
    doctrine/persistence 2.1.0 The Doctrine Persistence project is a set of shared interfaces and functionality that the dif...
    doctrine/reflection 1.2.1 The Doctrine Reflection project is a simple library used by the various Doctrine projects whi...
    doctrine/sql-formatter 1.1.1 a PHP SQL highlighting library
    egulias/email-validator 2.1.24 A library for validating emails against several RFCs
    exeu/apai-io 2.2.0 Amazon Product Advertising PHP Library
    friendsofsymfony/rest-bundle 3.0.3 This Bundle provides various tools to rapidly develop RESTful API's with Symfony
    gedmo/doctrine-extensions v3.0.0 Doctrine2 behavioral extensions
    guzzlehttp/guzzle 6.3.3 Guzzle is a PHP HTTP client library
    guzzlehttp/promises 1.4.0 Guzzle promises library
    guzzlehttp/psr7 1.5.2 PSR-7 message implementation that also provides common utility methods
    jean85/pretty-package-versions 1.5.1 A wrapper for ocramius/package-versions to get pretty versions strings
    jms/metadata 2.4.0 Class/method/property metadata management in PHP
    jms/serializer 3.10.0 Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.
    jms/serializer-bundle 3.7.0 Allows you to easily serialize, and deserialize data of any complexity
    justinrainbow/json-schema 5.2.10 A library to validate a json schema.
    mikemccabe/json-patch-php 0.1.0 Produce and apply json-patch objects
    mongodb/mongodb 1.8.0 MongoDB driver library
    monolog/monolog 2.2.0 Sends your logs to files, sockets, inboxes, databases and various web services
    mtdowling/jmespath.php 2.6.0 Declaratively specify how to extract elements from a JSON document
    myclabs/deep-copy 1.10.2 Create deep copies (clones) of your objects
    nelmio/cors-bundle 2.1.0 Adds CORS (Cross-Origin Resource Sharing) headers support in your Symfony application
    nikic/php-parser v4.10.3 A PHP parser written in PHP
    ocramius/proxy-manager 2.2.3 A library providing utilities to generate, instantiate and generally operate with Object Proxies
    pagerfanta/pagerfanta v2.5.1 Pagination for PHP
    phar-io/manifest 2.0.1 Component for reading manifest information from a PHP Archive (PHAR)
    phar-io/version 3.0.4 Library for handling version information and constraints
    phpdocumentor/reflection-common 2.2.0 Common reflection classes used by phpdocumentor to reflect the code structure
    phpdocumentor/reflection-docblock 5.2.2 With this component, a library can provide support for annotations via DocBlocks or otherwise...
    phpdocumentor/type-resolver 1.4.0 A PSR-5 based resolver of Class names, Types and Structural Element Names
    phpspec/prophecy 1.12.2 Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage 7.0.14 Library that provides collection, processing, and rendering functionality for PHP code covera...
    phpunit/php-file-iterator 2.0.3 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.1.3 Utility class for timing
    phpunit/php-token-stream 3.1.2 Wrapper around PHP's tokenizer extension.
    phpunit/phpunit 8.5.13 The PHP Unit Testing framework.
    psr/cache 1.0.1 Common interface for caching libraries
    psr/container 1.0.0 Common Container Interface (PHP FIG PSR-11)
    psr/event-dispatcher 1.0.0 Standard interfaces for event handling.
    psr/http-message 1.0.1 Common interface for HTTP messages
    psr/log 1.1.3 Common interface for logging libraries
    ralouphie/getallheaders 2.0.5 A polyfill for getallheaders.
    roave/security-advisories dev-master d596191 Prevents installation of composer packages with known security vulnerabilities: no API, simpl...
    sebastian/code-unit-reverse-lookup 1.0.2 Looks up which function or method a line of code belongs to
    sebastian/comparator 3.0.3 Provides the functionality to compare PHP values for equality
    sebastian/diff 3.0.3 Diff implementation
    sebastian/environment 4.2.4 Provides functionality to handle HHVM/PHP environments
    sebastian/exporter 3.1.3 Provides the functionality to export PHP variables for visualization
    sebastian/global-state 3.0.1 Snapshotting of global state
    sebastian/object-enumerator 3.0.4 Traverses array structures and object graphs to enumerate all referenced objects
    sebastian/object-reflector 1.1.2 Allows reflection of object attributes, including inherited and non-public ones
    sebastian/recursion-context 3.0.1 Provides functionality to recursively process PHP variables
    sebastian/resource-operations 2.0.2 Provides a list of PHP built-in functions that operate on resources
    sebastian/type 1.1.4 Collection of value objects that represent the types of the PHP type system
    sebastian/version 2.0.1 Library that helps with managing the version number of Git-hosted PHP projects
    sensio/framework-extra-bundle v5.6.1 This bundle provides a way to configure your controllers with annotations
    softcreatr/jsonpath 0.7.2 JSONPath implementation for parsing, searching and flattening arrays
    stof/doctrine-extensions-bundle v1.5.0 Integration of the gedmo/doctrine-extensions with Symfony2
    symfony/amazon-mailer v5.2.0 Symfony Amazon Mailer Bridge
    symfony/amqp-messenger v5.2.0 Symfony AMQP extension Messenger Bridge
    symfony/browser-kit v5.2.1 Symfony BrowserKit Component
    symfony/cache v5.2.0 Symfony Cache component with PSR-6, PSR-16, and tags
    symfony/cache-contracts v2.2.0 Generic abstractions related to caching
    symfony/config v5.2.0 Symfony Config Component
    symfony/console v5.2.0 Symfony Console Component
    symfony/css-selector v5.2.1 Symfony CssSelector Component
    symfony/dependency-injection v5.2.0 Symfony DependencyInjection Component
    symfony/deprecation-contracts v2.2.0 A generic function and convention to trigger deprecation notices
    symfony/doctrine-bridge v5.2.0 Symfony Doctrine Bridge
    symfony/doctrine-messenger v5.2.0 Symfony Doctrine Messenger Bridge
    symfony/dom-crawler v5.2.1 Symfony DomCrawler Component
    symfony/dotenv v5.2.0 Registers environment variables from a .env file
    symfony/error-handler v5.2.0 Symfony ErrorHandler Component
    symfony/event-dispatcher v5.2.0 Symfony EventDispatcher Component
    symfony/event-dispatcher-contracts v2.2.0 Generic abstractions related to dispatching event
    symfony/expression-language v5.2.0 Symfony ExpressionLanguage Component
    symfony/filesystem v5.2.0 Symfony Filesystem Component
    symfony/finder v5.2.0 Symfony Finder Component
    symfony/flex v1.11.0 Composer plugin for Symfony
    symfony/framework-bundle v5.2.0 Symfony FrameworkBundle
    symfony/http-client-contracts v2.3.1 Generic abstractions related to HTTP clients
    symfony/http-foundation v5.2.0 Symfony HttpFoundation Component
    symfony/http-kernel v5.2.0 Symfony HttpKernel Component
    symfony/mailer v5.2.0 Symfony Mailer Component
    symfony/maker-bundle v1.25.0 Symfony Maker helps you create empty commands, controllers, form classes, tests and more so y...
    symfony/messenger v5.2.0 Symfony Messenger Component
    symfony/mime v5.2.0 A library to manipulate MIME messages
    symfony/monolog-bridge v5.2.0 Symfony Monolog Bridge
    symfony/monolog-bundle v3.6.0 Symfony MonologBundle
    symfony/options-resolver v5.2.0 Symfony OptionsResolver Component
    symfony/polyfill-intl-grapheme v1.20.0 Symfony polyfill for intl's grapheme_* functions
    symfony/polyfill-intl-idn v1.20.0 Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
    symfony/polyfill-intl-normalizer v1.20.0 Symfony polyfill for intl's Normalizer class and related functions
    symfony/polyfill-mbstring v1.20.0 Symfony polyfill for the Mbstring extension
    symfony/polyfill-php73 v1.20.0 Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
    symfony/polyfill-php80 v1.20.0 Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
    symfony/property-access v5.2.0 Symfony PropertyAccess Component
    symfony/property-info v5.2.0 Symfony Property Info Component
    symfony/redis-messenger v5.2.0 Symfony Redis extension Messenger Bridge
    symfony/routing v5.2.0 Symfony Routing Component
    symfony/security-bundle v5.2.0 Symfony SecurityBundle
    symfony/security-core v5.2.0 Symfony Security Component - Core Library
    symfony/security-csrf v5.2.0 Symfony Security Component - CSRF Library
    symfony/security-guard v5.2.0 Symfony Security Component - Guard
    symfony/security-http v5.2.0 Symfony Security Component - HTTP Integration
    symfony/serializer v5.2.0 Symfony Serializer Component
    symfony/service-contracts v2.2.0 Generic abstractions related to writing services
    symfony/stopwatch v5.2.0 Symfony Stopwatch Component
    symfony/string v5.2.0 Symfony String component
    symfony/translation v5.2.0 Symfony Translation Component
    symfony/translation-contracts v2.3.0 Generic abstractions related to translation
    symfony/twig-bridge v5.2.0 Symfony Twig Bridge
    symfony/twig-bundle v5.2.0 Symfony TwigBundle
    symfony/validator v5.2.0 Symfony Validator Component
    symfony/var-dumper v5.2.0 Symfony mechanism for exploring and dumping PHP variables
    symfony/var-exporter v5.2.0 A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code
    symfony/web-profiler-bundle v5.2.0 Symfony WebProfilerBundle
    symfony/workflow v5.2.0 Symfony Workflow Component
    symfony/yaml v5.2.0 Symfony Yaml Component
    theseer/tokenizer 1.2.0 A small library for converting tokenized PHP source code into XML and potentially other formats
    twig/twig v3.1.1 Twig, the flexible, fast, and secure template language for PHP
    webmozart/assert 1.9.1 Assertions to validate method input/output with nice error messages.
    willdurand/jsonp-callback-validator v1.1.0 JSONP callback validator.
    willdurand/negotiation v2.3.1 Content Negotiation tools for PHP provided as a standalone library.
    zendframework/zend-code 3.4.1 Extensions to the PHP Reflection API, static code scanning, and code generation
    zendframework/zend-eventmanager 3.2.1 Trigger and listen to events within a PHP application

  • Suite configuration:

actor: ApiTester
        - REST:
              url: http://p2p.test/platform/api/v1/
              depends: PhpBrowser
        - \App\Tests\Helper\Api
Copy link

Naktibalda commented Jan 15, 2021

Are you sure that Undefined variable: file warning didn't happen in your code?

Copy link

Naktibalda commented Jan 15, 2021

ErrorHandler could be improved to add filename and line to exception message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging a pull request may close this issue.

2 participants