0 Best Reply Awards

  • Member Since 1 Year Ago
  • 125 Lessons Completed
  • 7 Favorites

18th December, 2017

fureszk left a reply on Faker\Factory Class Is Not Found • 6 months ago

@nfauchelle thank you, this was the case for me. I have installed dependencies with "--no-dev" before manual deployment and totally forgot to install them again.

13th September, 2017

fureszk left a reply on AssertDatabaseHas Not Working As Expected • 9 months ago

All I had to do is show PHPStorm what configuration file to use (phpunit.xml). Solved.

fureszk left a reply on [5.5] Parsing Whoops Errors In AssertSee • 9 months ago

well, you can check storage/logs/laravel.log clear the file before running the single test

fureszk started a new conversation AssertDatabaseHas Not Working As Expected • 9 months ago

Hello Everyone,

I'm having an issue with testing Laravel 5.5.

I have modified phpunit.xml to use DB_CONNECTION "testing", which is a mysql database. I have overridden assertDatabaseHas to use the same connection and using DatabaseTransactions, so my TestCase class looks like this:

abstract class TestCase extends BaseTestCase
    use CreatesApplication, DatabaseTransactions;
    public function assertDatabaseHas($table, array $data, $connection = 'testing')
        return parent::assertDatabaseHas($table, $data, $connection);

My other tests work great, but assertDatabaseHas doesnt seem to work. I created an example:

class ExampleTest extends TestCase
     * A basic test example.
     * @return void
    public function testExample()
        $details = [
            'email' => sha1('[email protected]'),
            'token' => str_random(10),


        $this->assertDatabaseHas('tokens', $details);

Fails with the following message:

Failed asserting that a row in the table [tokens] matches the attributes {
    "email": "16a6ce8524fcf78c938b8b98e97525c8b20c9fb3",
    "token": "xlCqvCD1Np"

The table is empty.
Edit Your Profile

Want to change your profile photo? We pull from gravatar.com.