laracasts / Integrated

Simple, intuitive integration testing with PHPUnit.
https://laracasts.com/series/intuitive-integration-testing
MIT License
474 stars 87 forks source link

PHP Fatal error when running tests after upgrading to Laravel 5.1 #81

Closed element25 closed 9 years ago

element25 commented 9 years ago

Since upgrading to Laravel 5.1 (dev-master, see composer.json below), I'm getting the following error each time I try and run even the most basic tests eg $this->visit('/login');

Access level to Illuminate\Foundation\Testing\TestCase::see() must be public (as in class Laracasts\Integrated\Emulator) in /Users/...../vendor/laracasts/integrated/src/Extensions/Laravel.php on line 10

{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "laravel/framework": "dev-master", "doctrine/dbal": "~2.5", "illuminate/html": "~5.0", "laracasts/flash": "~1.3", "fzaninotto/faker": "~1.4", "league/flysystem-aws-s3-v2": "~1.0", "guzzlehttp/guzzle": "~4.0", "filp/whoops": "~1.0", "vinkla/hashids": "~1.0", "iron-io/iron_mq": "2.*" }, "require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "laracasts/integrated": "0.15.*" }, "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "classmap": [ "tests/TestCase.php" ] }, "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 -r \"copy('.env.example', '.env');\"", "php artisan key:generate" ] }, "config": { "preferred-install": "dist" }, "minimum-stability": "dev", "prefer-stable": true }

bobbybouwmann commented 9 years ago

How does your TestCase.php look like? You can use this as an example: https://github.com/laravel/laravel/tree/master/tests

element25 commented 9 years ago

Hi Bobby,

When I use the code on the page you linked to above, the testing works with no other tests in the tests folder (or subfolders). When I change it to the following from the docs and run the tests (with no other tests in the tests folder or subfolders), there are also no PHP errors.

<?php

use Laracasts\Integrated\Extensions\Laravel as IntegrationTest;

class TestCase extends IntegrationTest { / * Creates the application. * @return \Illuminate\Foundation\Application / public function createApplication() { $app = require DIR**.'/../bootstrap/app.php'; $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); return $app; } }

However, when I add a basic test such as the one below to a folder called "alert", it fails with the previous PHP fatal error.

<?php

class AlertTest extends TestCase {

/** @test */
public function it_verifies_that_pages_load_properly()
{
    $this->visit('/');
}

}

JeffreyWay commented 9 years ago

If you're using Laravel 5.1, you don't need this package anymore. Much of it has been integrated into core.

gkalligeros commented 8 years ago

what if i want to use Selenium extension ?