alexleonard
4 years ago
179
12
General

Codeception new Laravel5 Module throwing fatal error

Posted 4 years ago by alexleonard

I just ran a composer update on a project and previously my tests were running and passing fine, but now I get:

PHP Fatal error:  Call to undefined method Symfony\Component\HttpFoundation\Request::route() in /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php on line 146
                                                                              
  [Symfony\Component\Debug\Exception\FatalErrorException]                     
  Call to undefined method Symfony\Component\HttpFoundation\Request::route()  
                                                                              
  [Symfony\Component\Debug\Exception\FatalErrorException]                     
  Call to undefined method Symfony\Component\HttpFoundation\Request::route()  

FATAL ERROR. TESTS NOT FINISHED.
Call to undefined method Symfony\Component\HttpFoundation\Request::route() 
in /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:146

Then I noticed that the L5 module by @JanHenkG has been pulled into the main Codeception package so I removed "janhenkgerritsen/codeception-laravel5": "dev-master" from composer (leaving "codeception/codeception": "~2.0" as was) and updated again, and made sure to run codecept build again, but still the fatal error kicks in whenever I try to run any of my functional tests (don't currently have unit/acceptance tests on this project).

I checked through the sample project and I'm pretty sure the various yml files are configured correctly:

codeception.yml

actor: Tester
paths:
    tests: tests
    log: tests/_output
    data: tests/_data
    helpers: tests/_support
settings:
    bootstrap: _bootstrap.php
    colors: true
    memory_limit: 1024M
modules:
    config:
        Db:
            dsn: 'mysql:host=localhost;dbname=l5_site_testing'
            user: 'root'
            password: ''
            dump: tests/_data/dump.sql

functional.suite.yml

class_name: FunctionalTester
modules:
    enabled: [Filesystem, Laravel5, Db]
    config:
        Laravel5:
            environment_file: .env.testing

.env.testing

APP_ENV=testing
APP_DEBUG=true
APP_KEY=32charstringhere

DB_HOST=localhost
DB_DATABASE=l5_site_testing
DB_USERNAME=root
DB_PASSWORD=

CACHE_DRIVER=file
SESSION_DRIVER=native
QUEUE_DRIVER=beanstalkd

Anyone else come across this error?

Please sign in or create an account to participate in this conversation.