I hope someone there can help me. I am using laravel 4 and I have been writing my first unit tests for a while, but I have problems. I am trying to extend the TestCase class, but I am getting the following error:
PHP Fatal error: Class registrationTest contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Illuminate\Foundation\Testing\TestCase::createApplication) in /home/john/www/projects/MyPainChart.com/app/tests/registrationTest.php on line 4
Now, if I have this right, the error refers to the fact that the method is abstract, then its class must be abstract. As you can see below, the TestCase class is abstract. I searched for this error, but drew a space.
Trying to follow this chord on Laracasts https://laracasts.com/lessons/tdd-by-example , and although you must be a subscriber to watch the video below it, and as you can see, I do nothing with Jeffrey Way.
My test:
<?php
class registrationTests extends \Illuminate\Foundation\Testing\TestCase
{
public function make_sure_the_registration_page_loads_ok()
{
$this->assertTrue(true);
}
}
Start of the TestCase class:
<?php namespace Illuminate\Foundation\Testing;
use Illuminate\View\View;
use Illuminate\Auth\UserInterface;
abstract class TestCase extends \PHPUnit_Framework_TestCase {
By the way, the Laravel testing class does not autostart by default, so I tried both the full name of the class and used Illuminate \ Foundation \ Testing, and then just extended TestCase. I know that he can see this as soon as I do not fully qualify the name that he complains that the class cannot be found. I also tried:
composer dump-autoload
and
composer update
Any help appreciated
source
share