kennethjaysone's avatar

Laravel 5.1 - phpunit - ErrorException: Undefined property: ExampleTest::$baseUrl

I have the default setup. My composer.json has this:

"require-dev": {
  "fzaninotto/faker": "~1.4",
  "mockery/mockery": "0.9.*",
  "phpunit/phpunit": "~4.0",
  "phpspec/phpspec": "~2.1"
},

When i run phpunit, i get the following error: I'm not sure why?

PHPUnit 4.8.6 by Sebastian Bergmann and contributors.

E

Time: 272 ms, Memory: 13.25Mb

There was 1 error:

1) ExampleTest::testBasicExample
ErrorException: Undefined property: ExampleTest::$baseUrl

My ExampleTest.php contains the following code

<?php

class ExampleTest extends TestCase {

    /**
     * A basic functional test example.
     *
     * @return void
     */
    public function testBasicExample()
    {
        $response = $this->call('GET', '/');

        $this->assertEquals(200, $response->getStatusCode());
    }

}

I'm very new to testing. Thank you for helping.

0 likes
1 reply

Please or to participate in this conversation.