canadianlover

canadianlover

Freelancer at self-employed

Member Since 4 Years Ago

Vancouver, BC

Experience Points
23,780
Total
Experience

1,220 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
187
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 5
23,780 XP
Feb
20
6 days ago
Activity icon

Replied to Forum Episode 61 - Converting Returned User Data To Tribute JSON Data

I solved tthe problem. I just had to return the users->each function, although your solution is better.

Activity icon

Replied to Forum Episode 61 - Converting Returned User Data To Tribute JSON Data

I just did a dd. I searched for John Doe. $search returns John Doe and $users dumps the App\User model instance.

Activity icon

Started a new Conversation Forum Episode 61 - Converting Returned User Data To Tribute JSON Data

I have made it to episode 61 in the forum series. I saw in that episodes comment Atwho is no longer under development and to use Tributejs instead. I was able to successfully get Tribute working in a new Laravel project.

According to https://github.com/zurb/tribute, it parses JSON data in the following format:

   {key: 'Foxface', value: 'foxyweapons'}    

My question is how do I output data in the above JSON format (key: 'username', value 'username') in my UsersController.php file? I have tried the following, but it did not work (it just returns an empty array:

<?php

namespace App\Http\Controllers\Api;

use App\User;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class UsersController extends Controller
{
    public function index() {
        $search = request('name');
        $users = User::where('name', 'LIKE', "$search%")->take(5)->get();
        $response = [];
        $users->each(function($user) use ($response) {
            $response[] = ['key' => $user->name, 'value' => $user->name];
        });
        return json_encode($response);

    }

}

Thanks

Feb
14
1 week ago
Activity icon

Replied to User Factory Generates Collection Instead Of Authenticable Trait

<?php
function create($class, $attributes = [], $times = 1) {
    return factory($class, $times)->create($attributes);
}

function make($class, $attributes = [], $times = 1) {
    return factory($class, $times)->create($attributes);
}

Activity icon

Started a new Conversation User Factory Generates Collection Instead Of Authenticable Trait

I have the following test

    public function test_only_administrators_can_add_files() {
        $brian = create('App\User', ['name' => 'Brain Hull']);
        $user = create("App\User");
        $file = create('App\Document');

        $this->signIn($brian);
        $this->post('/documents/store', $file->toArray())->assertStatus(201);

        $this->signIn($user);
        $this->post('/documents/store', $file->toArray())->assertStatus(403);

    }

My User model ilooks like this:

<?php

namespace App;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Auth\Authenticatable as AuthenticableTrait;
use Illuminate\Database\Eloquent\Model;

class User extends Model implements Authenticatable
{
    use AuthenticableTrait;




    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [
        'email_verified_at' => 'datetime',
    ];
}

My User factory looks like this:

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

$factory->define(User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,
        'email' => $faker->unique()->safeEmail,
        'email_verified_at' => now(),
        'password' => 'yIXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
        'remember_token' => Str::random(10),
    ];
});

I am using Laravel 6 and I have not changed anything to Laravel's user system. For some reason when I run my test I gedt the following error:

1) Tests\Feature\FileTest::test_only_administrators_can_add_files
TypeError: Argument 1 passed to Illuminate\Foundation\Testing\TestCase::actingAs() must implement interface Illuminate\Contracts\Auth\Authenticatable, instance of Illuminate\Database\Eloquent\Collection given, called in /home/vagrant/Code/documents/tests/TestCase.php on line 15

/home/vagrant/Code/documents/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php:16
/home/vagrant/Code/documents/tests/TestCase.php:15
/home/vagrant/Code/documents/tests/Feature/FileTest.php:32

My User.php file extends the rewquired class, but for some reason my create method is returning a collection instead of authenticible.

Here is my TestCase.php file:

<?php

namespace Tests;

use Illuminate\Foundation\Testing\TestCase as BaseTestCase;

abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;

    protected function signIn($user = null) {

        $user = $user ?: create('App\User');

        $this->actingAs($user);

        return $this;
    }

}

What's wrong?

Feb
05
3 weeks ago
Activity icon

Replied to Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

Ut works! Thats for all of that effort, much appreciated!

Activity icon

Replied to Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

As requested in the meeting, here is the code

https://github.com/TomMorison12/intransportal

Windows is weird, so I'm installing Linux on my new machine.

Activity icon

Replied to Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

I have went through all the files still no luck. I also put the check in the controller, still no luck. The exception does get thrown though.

This error is really stressing me out.

RepliesController.php

<?php

namespace App\Http\Controllers;
use App\Reply;
use App\Spam;
use App\Thread;
use Auth;

use Illuminate\Http\Request;
use Illuminate\Support\Str;

class RepliesController extends Controller
{

    public function __construct() {
        $this->middleware('auth')->except('index');
    }

    /**
     * @param $channelId
     * @param Thread $thread
     * @param Spam $spam
     * @return \Illuminate\Database\Eloquent\Model|\Illuminate\Http\RedirectResponse
     * @throws \Illuminate\Validation\ValidationException
     * @throws \Exception
     */
    public function store($channelId, Thread $thread)
    {
        $this->validate(request(), ['body' => 'required']);

        $spam = new Spam();

        $spam->detect('yahoo customer support');



        $reply = $thread->addReply([
            'body' => request('body'),

            'user_id' => Auth::user()->id
        ]);


        if(request()->wantsJson())
         return $reply->load('owner');

        return back()->with('flash', "Your reply has been left");
    }

    public function destroy(Reply $reply) {
        $this->authorize('update', $reply);
        $reply->delete();
        if(request()->expectsJson()) return response(['status' => 'The reply has been deleted']);

       return back()->with('flash', 'Your reply has been deleted');
    }

    public function update(Reply $reply) {
        $this->authorize('update', $reply);
        $reply->update(['body' => request('body')]);
    }

    public function index($channelId, Thread $thread) {

        return $thread->replies()->paginate(20);

    }
 }
Activity icon

Replied to Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

DO I have to take out the wwithoutexceptionhandling in all my files? Yes, the spam testis the last test.

Activity icon

Replied to Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

I've removed the withoutexceptionhandling but I'm still getting that error.

Activity icon

Started a new Conversation Spam Detection Forum Episode = Failed Asserting Exception Was Thrown

I have been following Jeffery's build a forum series and I am on episode 49. I am stuck on as weird error. Here is my ParticipateInForumTest.php file

<?php

namespace Tests\Feature;

use Exception;
use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ParticipateInForumTest extends TestCase
{
    use DatabaseMigrations;    /**
     * A basic feature test example.
     *
     * @return void
     */

    function test_unauthenticated_users_may_not_participate_in_thread() {

        $this->expectException(\Illuminate\Auth\AuthenticationException::class);
        $this->withoutExceptionHandling()->post(page_url('forum', '/threads/some-channel/1/replies'), []);

    }
  function test_an_authenticated_user_can_pariticipate_in_forum_threads() {
      $user = factory('App\User')->create();

      $this->be($user);
      $thread = factory('App\Thread')->create();
      $reply = factory('App\Reply')->make();

      $this->post($thread->path().'/replies', $reply->toArray());

      $this->assertDatabaseHas('replies', ['body' => $reply->body]);
      $this->assertEquals(1, $thread->fresh()->replies_count);
  }

  function test_a_reply_requires_a_body() {
        $this->withExceptionHandling()->signIn();

        $thread = create('App\Thread');
        $reply = make('App\Reply', ['body' => null]);

        $this->post($thread->path(). '/replies', $reply->toArray())
        ->assertSessionHasErrors(['body']);
  }

  function test_unauthorized_users_cannot_delete_replies()
  {
      $reply = create('App\Reply');

      $this->delete(page_url('forum','replies/' . $reply->id))->assertRedirect(page_url(null,'/login'));
      $this->signIn()->delete(page_url('forum', 'replies/' . $reply->id))->assertStatus(403);
  }
  function test_authorized_users_can_update_replies() {
    $this->signIn();
    $reply = create('App\Reply', ['user_id' => auth()->id()]);
    $this->patch(page_url('forum','replies/'.$reply->id), ['body' => "You've been changed, punk"]);

    $this->assertDatabaseHas('replies', ['id' => $reply->id, 'body' => "You've been changed, punk"]);


    }

    function test_authorized_users_can_delete_replies() {
        $this->signIn();
        $reply = create('App\Reply', ['user_id' => auth()->id()]);
        $this->delete(page_url('forum', "/replies/{$reply->id}"));
        $this->assertDatabaseMissing('replies', ['id' => $reply->id]);
        $this->assertEquals(0, $reply->thread->fresh()->replies_count);
    }

    function test_unauthorized_users_cannot_update_replies()
    {
        $reply = create('App\Reply');

        $this->patch(page_url('forum','replies/' . $reply->id))->assertRedirect(page_url(null, '/login'));
        $this->signIn()->patch(page_url('forum', 'replies/' . $reply->id))->assertStatus(403);
    }
    /**
     * A basic unit test example.
     *
     * @return void
     * @throws \Exception
     */
    function test_replies_that_contain_spam_may_not_be_created()
    {
        $this->signIn();


        $thread= create('App\Thread');

        $reply = make('App\Reply', [
           'body' => 'yahoo customer support'
    ]);
        $this->expectException(Exception::class);


        $this->post($thread->path().'/replies', $reply->toArray());





    }
}

and here is my Spam.php file

<?php

namespace App;

use Mockery\Exception;

Class Spam {
    /** *
     * @param $body
     * @return bool
     * @throws \Exception
     */
    public function detect($body) {

            $this->detectInvalidKeywords($body);

        return false;
    }

    /** *
     * @param $body
     * @throws \Exception
     */
    public function detectInvalidKeywords($body) {

        $invalids = [
            'yahoo customer support',

        ];

        foreach($invalids as $keyword) {
            if(stripos($body, $keyword) !== false)
                 throw new \Exception('Your reply contains spam');
        }

    }
}

I have dd the $this->post method and in the dumped content I do get the exception, however, when I try to run the test normally, I get the following error

Failed asserting that exception of type "Exception" is thrown.

Ireally do not understand this exception. What am I doing wrong?

Jan
21
1 month ago
Activity icon

Replied to Best Way To Sway Clients Away From Using WordPress

I didn't realize my question would cause a flame war lol. Anyway, i'll use WordPress and not do any coding, If my client wants it, his wish is my command.

Jan
19
1 month ago
Activity icon

Replied to Best Way To Sway Clients Away From Using WordPress

Ten years ago, I was at a computer shop. I wanted to spend $2000 on computer to play games. I wanted the best video card and processor. The store clerk told me to just get a machine that had an AMD graphics card integrated onto the motherboard. I ended up buying that rig and I was able to play Fallout 3 just fine.

@fylzero I do not take offense to you calling me a junior, and your post made me realize that sometimes the simplest option is better than doing anything advanced -especially when it's unnecessary. I was poking around with Yii and I hated the fact that models were generated using a web-based GUI - I liked the command line better just because it was more difficult to use. I even wrote a PHPUnit test for my uncles project, which may not be necessary since I'm only pulling document records from a database.

I guess the takeaway from this discussion is "advanced" does not always mean "better'.

Jan
18
1 month ago
Activity icon

Started a new Conversation Best Way To Sway Clients Away From Using WordPress

I would like to start off by saying I do not consider myself to be a senior web developer. At the same time, I don't like using CMS software like WordPress or Joomla because to me it's like telling me to ride my bicycle with training wheels - I am beyond that level.

My uncle gave me a project to work on and told me to build it using domain.com's website builder. He explicitly told me not to write code as he is "not looking for something fancy". In my mind, that's like telling me to take Grade 10 algebra when I have already graduated high school. Using WYSIWYG software or whatever domain.com's "websibte builder" is not fun for me. He stresses he want's something simple.

How do I get my uncle to understand basic websites can easily be created using Laravel? Should I just do it his way and accept easy money, or am I on to something about using Laravel?

Dec
30
1 month ago
Activity icon

Started a new Conversation This Is Undefined In Computer Proerty (forum Episode 24)

I closely followed Jeffery's tutorial. I currently have this as my Favorite.vue file:

<button type="submit" :class="classes" @click="toggle">
    <span class="glyphicon glyphicon-heart"></span>
    <span v-text="favoritesCount"></span>
</button>
</template>

<script>
    export default {
        props: ['reply'],


        data: function() {
            return {
                favoritesCount: this.reply.favoritesCount,
                isFavorited: true
            }
        },
        computed: {
            classes: function() {
                return 'btn '. this.isFavorited ? 'btn-primary' : 'btn-default';
            }.bind(this)
        },

        methods: {
            toggle: function() {
                if (this.isFavorited) {
                    axios.delete('/replies/' + this.reply.id + '/favorites');
                } else {
                    axios.post('/replies/' + this.reply.id + '/favorites');

                }
            }
        },
        created() {
            console.log(this)
        }
    }
</script>

However, after recompiling my components and reloading thepage, I get this error:

[Vue warn]: Error in render: "TypeError: Cannot read property 'isFavorited' of undefined"

After commenting out the computed property, the child component renders perfectly. I tried binding this to the property with no avil. I have been tearing my hear out wondering why I get this error. I am 100% sure it has something to do with the computed property, since my code compiles with no errors when i commenting it out

Reply.vue

    import Favorite from './Favorite.vue';
    export default {

        props: ['attributes'],
        components: { Favorite },
        data() {
            return {
                editing: false,
                body: this.attributes.body

            };
        },
        methods: {
            update() {
                axios.patch('/replies/' + this.attributes.id, {
                    body: this.body
                });
                this.editing = false;

            },
            destroy() {
                axios.delete('/replies/' + this.attributes.id);
                $(this.$el).fadeOut(300, function() {
                flash('Your reply has been deleted');
                });


            }
        }
    }
</script>
Dec
09
2 months ago
Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

I have poked around at this for the past 20 minutes. Here's what I did.

I removed the boot() method completely. There are still errors which have come up after I changed everything over to my subdomain. (IE there are some paths that are not correct.

I believe when I fix the paths to the new subdomain route, (hopefully) everything will work.

Here is what phpunit says now

`` PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

F

...F....F.FFF..FF.F.......F 28 / 28 (100%)

Time: 11.68 seconds, Memory: 30.00 MB

There were 10 failures:

  1. Tests\Unit\ActivityTest::test_it_records_activity_when_a_test_is_created Failed asserting that a row in the table [activities] matches the attributes { "type": "created_thread", "0": "user_id", "1": 1, "subject_id": 1, "subject_type": "App\Thread" }.

The table is empty.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php:24 /home/vagrant/Code/intransportal/tests/Unit/ActivityTest.php:24 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_can_make_a_string_path Failed asserting that two strings are equal. --- Expected +++ Actual @@ @@ -'http://forum.intransportal.testthreads/est/2' +'http://forum.intransportal.test/threads/est/2'

/home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:29 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_guests_may_not_create_threads Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:19 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_title Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:34 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_body Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:39 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_channel_id Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:45 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_guests_may_not_favorite_anything Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_an_authentcated_user_can_favorite_any_reply Failed asserting that actual size 0 matches expected size 1.

/home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:33 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ParticipateInForumTest::test_unauthenticated_users_may_not_participate_in_thread Failed asserting that exception of type "Symfony\Component\HttpKernel\Exception\NotFoundHttpException" matches expected exception "Illuminate\Auth\AuthenticationException". Message was: "POST http://forum.intransportal.testthreads/some-channel/1/replies" at /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php:118 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:326 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:120 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:375 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:197 /home/vagrant/Code/intransportal/tests/Feature/ParticipateInForumTest.php:21 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159 .

/home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_filter_threads_by_popularity Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array (
  • 0 => 3
  • 1 => 2
  • 2 => 0 )

/home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:80 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

FAILURES! Tests: 28, Assertions: 37, Failures: 10. [email protected]:~/Code/intransportal$ phpunit PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

F

........F.FFF..FF.F.......F 28 / 28 (100%)

Time: 14.47 seconds, Memory: 30.00 MB

There were 9 failures:

  1. Tests\Unit\ActivityTest::test_it_records_activity_when_a_test_is_created Failed asserting that a row in the table [activities] matches the attributes { "type": "created_thread", "0": "user_id", "1": 1, "subject_id": 1, "subject_type": "App\Thread" }.

The table is empty.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php:24 /home/vagrant/Code/intransportal/tests/Unit/ActivityTest.php:24 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_guests_may_not_create_threads Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:19 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_title Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:34 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_body Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:39 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_channel_id Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:45 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_guests_may_not_favorite_anything Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_an_authentcated_user_can_favorite_any_reply Failed asserting that actual size 0 matches expected size 1.

/home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:33 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ParticipateInForumTest::test_unauthenticated_users_may_not_participate_in_thread Failed asserting that exception of type "Symfony\Component\HttpKernel\Exception\NotFoundHttpException" matches expected exception "Illuminate\Auth\AuthenticationException". Message was: "POST http://forum.intransportal.testthreads/some-channel/1/replies" at /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php:118 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:326 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:120 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:375 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:197 /home/vagrant/Code/intransportal/tests/Feature/ParticipateInForumTest.php:21 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159 .

/home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_filter_threads_by_popularity Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array (
  • 0 => 3
  • 1 => 2
  • 2 => 0 )

/home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:80 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159 ``

Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

Line 30 of my thread.php file. In my last post, I retyped the line by hand and forgot the '. My bad.

Here is what the snippit looks like now

        static::created(function($thread) {

            Activity:create([
                'user_id' => auth()->id(),
                'type' => 'created_thread',

                'subject_type' => Thread::class,
                'subject_id' => $thread->id
            ]);
        });
``
Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

Nope, I'm not overriding anything. The stacktrace is now saying the error is on line 30., ['subject_id => $thread->id] I have no idea why this isnt working

Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

I'm pretty sure it's this is causing the error

        static::created(function($thread) {

            Activity:create([
                'user_id' => auth()->id(),
                'type' => 'created_thread',

                'subject_type' => 'App\Thread', // something to do with this
                'subject_id' => 1
            ]);
        });```
Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

Edited last post and added code.

Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

Here's the line from my thread test $this->thread = factory('App\Thread')->create();

Also, here's the full test. I am running the tests from my vagrant box.


namespace Tests\Unit;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ThreadTest extends TestCase
{
    protected $thread;
    /**
     * A basic unit test example.
     *
     * @return void
     */

    use DatabaseMigrations;
    public function setUp() :void {
        parent::setUp();

        $this->thread = factory('App\Thread')->create();
    }

    function test_a_thread_can_make_a_string_path() {
        $thread = create('App\Thread');

        $this->assertEquals('/forum/threads/'. $thread->channel->slug.'/'.$thread->id, $thread->path());

    }

    public function test_a_thread_has_replies()
    {


        $this->assertInstanceOf('Illuminate\Database\Eloquent\Collection', $this->thread->replies);



    }

    function test_a_thread_has_a_creator()
    {

        $this->assertInstanceOf('App\User', $this->thread->creator);

    }

    public function test_a_thread_can_add_a_reply() {
        $this->thread->addReply([
            'body' => 'fooBar',
            'user_id' => 1
        ]);

        $this->assertCount(1, $this->thread->replies);




    }

    function test_a_thread_belongs_to_a_channel() {
        $thread = create('App\Thread');

        $this->assertInstanceOf('App\Channel', $thread->channel);
    }
}
Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

Unfortunately, that did not solve the problem :(

Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

I have already taken care of the routing

<?php

/** @var \Illuminate\Database\Eloquent\Factory $factory */

use App\Thread;
use Faker\Generator as Faker;

$factory->define(Thread::class, function (Faker $faker) {
    return [
        'user_id' => function() {
            return factory('App\User')->create()->id;
        },
        'channel_id' => function() {
            return create('App\Channel')->id;
        },
        'title' => $faker->sentence,
        'body' => $faker->paragraph
    ];
});

Activity icon

Replied to Forum Episode 25 - Class Name Must Be A Valid Object Or A String

@Nakov sorry, I meant a subdomain. forum.mydomain.com, not a TLD

Activity icon

Started a new Conversation Forum Episode 25 - Class Name Must Be A Valid Object Or A String

I am following the Forum series. I recently changed my web.php file to point all of the forum specific routes to a domain name. Now when I run phpunit I see this error over and over after I add the static created method to the Thread model

Class name must be a valid object or a string

Not sure why I'm getting this error.

Here is the full error with stacktraces:

`` PHPUnit 7.5.16 by Sebastian Bergmann and contributors.

E

E.EEEEEEFEFFFEEFEEFEE.EEEEE 28 / 28 (100%)

Time: 8.71 seconds, Memory: 32.00 MB

There were 20 errors:

  1. Tests\Unit\ActivityTest::test_it_records_activity_when_a_test_is_created Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Unit/ActivityTest.php:18 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ChannelTest::test_a_channel_consists_of_threads Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Unit/ChannelTest.php:21 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReplyTest::test_it_has_an_owner Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:116 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/database/factories/ReplyFactory.php:14 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:363 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:278 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:292 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/Unit/ReplyTest.php:19 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_can_make_a_string_path Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_has_replies Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_has_a_creator Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_can_add_a_reply Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Unit\ThreadTest::test_a_thread_belongs_to_a_channel Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Unit/ThreadTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_an_authenticated_user_can_create_new_forum_threads Symfony\Component\Debug\Exception\FatalThrowableError: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:795 /home/vagrant/.composer/vendor/illuminate/support/helpers.php:424 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:796 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:23 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1618 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1630 /home/vagrant/Code/intransportal/app/Http/Controllers/ThreadsController.php:65 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Route.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Route.php:176 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:680 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php:43 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:75 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:56 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:682 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:657 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:623 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Router.php:612 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30 /home/vagrant/Code/intransportal/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php:58 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/fideloper/proxy/src/TrustProxies.php:57 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:375 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:197 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:27 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_guests_cannot_delete_threads Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:50 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_authorized_users_can_delete_threads Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:65 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_an_authentcated_user_can_favorite_any_reply Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:116 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/database/factories/ReplyFactory.php:14 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:363 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:278 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:292 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:28 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_an_authenticated_user_may_only_favorite_a_reply_once Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:116 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/database/factories/ReplyFactory.php:14 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:363 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:278 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:292 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:39 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ParticipateInForumTest::test_an_authenticated_user_can_pariticipate_inm_forum_threads Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Feature/ParticipateInForumTest.php:28 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ParticipateInForumTest::test_a_reply_requires_a_body Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/ParticipateInForumTest.php:39 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ProfilesTest::test_profiles_display_all_threads_by_user Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/tests/Feature/ProfilesTest.php:27 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_read_all_threads Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_filter_threads_according_to_channel Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_filter_threads_by_any_username Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ReadThreadsTest::test_a_user_can_filter_threads_by_popularity Error: Class name must be a valid object or a string

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:291 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/GuardsAttributes.php:122 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:300 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:219 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:178 /home/vagrant/Code/intransportal/tests/utilities/functions.php:4 /home/vagrant/Code/intransportal/app/Thread.php:30 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:196 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasEvents.php:188 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:825 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:667 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:206 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Collection.php:475 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:207 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Database/Eloquent/FactoryBuilder.php:181 /home/vagrant/Code/intransportal/tests/Feature/ReadThreadsTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

--

There were 6 failures:

  1. Tests\Feature\CreateThreadsTest::test_guests_may_not_create_threads Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:19 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_title Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:34 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_body Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:39 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\CreateThreadsTest::test_a_thread_requires_a_channel_id Session is missing expected key [errors]. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:892 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:967 /home/vagrant/Code/intransportal/tests/Feature/CreateThreadsTest.php:45 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\FavoritesTest::test_guests_may_not_favorite_anything Response status code [404] is not a redirect status code. Failed asserting that false is true.

/home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:166 /home/vagrant/Code/intransportal/tests/Feature/FavoritesTest.php:23 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

  1. Tests\Feature\ParticipateInForumTest::test_unauthenticated_users_may_not_participate_in_thread Failed asserting that exception of type "Symfony\Component\HttpKernel\Exception\NotFoundHttpException" matches expected exception "Illuminate\Auth\AuthenticationException". Message was: "POST http://forum.intransportal.testthreads/some-channel/1/replies" at /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php:118 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:326 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:120 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:375 /home/vagrant/Code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:197 /home/vagrant/Code/intransportal/tests/Feature/ParticipateInForumTest.php:21 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159 .

/home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:200 /home/vagrant/.composer/vendor/phpunit/phpunit/src/TextUI/Command.php:159

ERRORS! Tests: 28, Assertions: 8, Errors: 20, Failures: 6. ``

Here is my Thread.php

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Thread extends Model
{
    protected $guarded = [];
//
    protected $with = ['creator', 'channel'];
    protected static function boot() {
        parent::boot();

        static::addGlobalScope('replyCount', function($builder) {
            $builder->withCount('replies');
        });

        static::deleting(function($thread) {
            $thread->replies()->delete();
        });

        static::created(function($thread) {

            Activity:create([
                'user_id' => auth()->id(),
                'type' => 'created_thread',

                'subject_type' => 'App\Thread',
                'subject_id' => $thread->id
            ]);
        });

    }
    public function path() {
        return page_url('forum',"/threads/" . $this->channel->slug . '/'.  $this->id);
    }

    public function replies() {
        return $this->hasMany(Reply::class);
    }

    public function channel() {
        return $this->belongsTo(Channel::class);
    }

    public function creator()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function addReply($reply) {
        $this->replies()->create($reply);
    }

    public function scopeFilter($query, $filters) {
        return $filters->apply($query);
    }


}

my create_activity_table.php


<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateActivitiesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activities', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->index();
            $table->string('subject_type', 50);
            $table->unsignedInteger('subject_id')->index();
            $table->string('type');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activities');
    }
}

and my ActivityTest.php

<?php

namespace Tests\Unit;

use Illuminate\Foundation\Testing\DatabaseMigrations;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ActivityTest extends TestCase
{

    use DatabaseMigrations;
    /**
     */
    public function test_it_records_activity_when_a_test_is_created() {
        $this->signIn();
        $thread = create('App\Thread');

        $this->assertDatabaseHas('activities', [
            'type' => 'created_thread',
            'user_id', auth()->id(),
            'subject_id' => $thread->id,
            'subject_type' => 'App\Thread'

        ]);
    }
}

Dec
03
2 months ago
Activity icon

Replied to Forum Episode 22 - Profiles Route Returns 404

Thank you! Working now

Activity icon

Started a new Conversation Forum Episode 22 - Profiles Route Returns 404

I do not know why I am getting this 404 error. I registered my profiles route and it shows up when I run php artisan route:list, however when I run my test or try to load the user's profile in the browser, I get a 404 error.

Here is my routes/web.php file

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Auth::routes();
Route::get('profiles/{user}', '[email protected]');
Route::get('/home', '[email protected]')->name('home');
//Route::resource('forum/threads', 'ThreadsController');

Route::get('/forum/threads/', '[email protected]');
Route::get('/forum/threads/create', '[email protected]');
Route::get('/forum/threads/{channel}/{thread}', '[email protected]');
Route::post('/forum/threads', '[email protected]');
Route::post('forum/threads/{channel}/{thread}/replies','[email protected]');
Route::get('/forum/threads/{channel}', '[email protected]');
Route::post('/forum/replies/{reply}/favorite', '[email protected]');


Route::resource('photos', 'PhotosController');

Here is my ProfilesControrller


namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
class ProfilesController extends Controller
{
    public function show(User $user) {
        return view('profiles.show', ['profileUser' => $user]);
    }

    public function getRouteKeyName() {
        return 'name';
    }
}

and my profiles.show view

@extends('layouts.app')

@section('content')
    {{$profileUser->name}}
    @endsection

What am I doing wrong?

Sep
25
5 months ago
Activity icon

Replied to Forum Episode 4 - Reply Not Showing Up On Threads Page

Yes, I did

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('/forum/threads', '[email protected]');

Auth::routes();

Route::get('/home', '[email protected]')->name('home');
Route::get('forum/threads/{thread}', '[email protected]');
Route::post('/forum/threads/{thread}/replies','[email protected]');

Route::resource('photos', 'PhotosController');

```<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Thread extends Model
{
    protected $guarded = [];
    public function path() {
        return "/forum/threads/" . $this->id;
    }

    public function replies() {
        return $this->hasMany(Reply::class);
    }

    public function creator()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function addReply($reply) {
        $this->replies->create($reply);
    }
}```
Activity icon

Started a new Conversation Forum Episode 4 - Reply Not Showing Up On Threads Page

I am following this tutorial: https://laracasts.com/series/lets-build-a-forum-with-laravel/episodes/4

I got to the end of the video, however my tests are failing.

I get the following error message when I run phpunit


....EF.                                                             7 / 7 (100%)

Time: 11.67 seconds, Memory: 26.00 MB

There was 1 error:

1) Tests\Unit\ThreadTest::test_a_thread_can_add_a_reply
BadMethodCallException: Method Illuminate\Database\Eloquent\Collection::create does not exist.

/home/vagrant/code/intransportal/vendor/laravel/framework/src/Illuminate/Support/Traits/Macroable.php:104
/home/vagrant/code/intransportal/app/Thread.php:24
/home/vagrant/code/intransportal/tests/Unit/ThreadTest.php:45

--

There was 1 failure:

1) Tests\Feature\ParticipateInForumTest::test_an_authenticated_user_can_pariticipate_inm_forum_threads
Failed asserting that '<!DOCTYPE html>\n
<html lang="en">\n
<head>\n
    <meta charset="utf-8">\n
    <meta name="viewport" content="width=device-width, initial-scale=1">\n
\n
    <!-- CSRF Token -->\n
    <meta name="csrf-token" content="49bnvJNuRlNrn2uDs0ZFlMW1Lp8qe7yYqBnlIiou">\n
\n
    <title>Laravel</title>\n
\n
    <!-- Scripts -->\n
    <script src="http://localhost/js/app.js" defer></script>\n
\n
    <!-- Fonts -->\n
    <link rel="dns-prefetch" href="//fonts.gstatic.com">\n
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">\n
\n
    <!-- Styles -->\n
    <link href="http://localhost/css/app.css" rel="stylesheet">\n
</head>\n
<body>\n
    <div id="app">\n
        <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">\n
            <div class="container">\n
                <a class="navbar-brand" href="http://localhost">\n
                    Laravel\n
                </a>\n
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">\n
                    <span class="navbar-toggler-icon"></span>\n
                </button>\n
\n
                <div class="collapse navbar-collapse" id="navbarSupportedContent">\n
                    <!-- Left Side Of Navbar -->\n
                    <ul class="navbar-nav mr-auto">\n
\n
                    </ul>\n
\n
                    <!-- Right Side Of Navbar -->\n
                    <ul class="navbar-nav ml-auto">\n
                        <!-- Authentication Links -->\n
                                                    <li class="nav-item dropdown">\n
                                <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>\n
                                    Dr. Mekhi Nienow III <span class="caret"></span>\n
                                </a>\n
\n
                                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">\n
                                    <a class="dropdown-item" href="http://localhost/logout"\n
                                       onclick="event.preventDefault();\n
                                                     document.getElementById('logout-form').submit();">\n
                                        Logout\n
                                    </a>\n
\n
                                    <form id="logout-form" action="http://localhost/logout" method="POST" style="display: none;">\n
                                        <input type="hidden" name="_token" value="49bnvJNuRlNrn2uDs0ZFlMW1Lp8qe7yYqBnlIiou">                                    </form>\n
                                </div>\n
                            </li>\n
                                            </ul>\n
                </div>\n
            </div>\n
        </nav>\n
\n
        <main class="py-4">\n
                <div class="container">\n
        <div class="row justify-content-center">\n
            <div class="col-md-8">\n
                <div class="card">\n
                    <div class="card-header"><a href="#">Alejandra Goodwin</a> posted Corrupti perspiciatis quos non odio.</div>\n
\n
                    <div class="card-body">\n
                        Et suscipit eligendi nam non itaque libero. Voluptatem quos repellat sed in. Commodi aut placeat doloribus cum quia itaque necessitatibus.\n
                    </div>\n
                </div>\n
            </div>\n
        </div>\n
\n
        <div class="row justify-content-center">\n
            <div class="col-md-8">\n
                \n
    </div>\n
        </main>\n
    </div>\n
</body>\n
</html>\n
' contains "Quae sint cupiditate aut sed tempore porro deserunt. Molestiae sed ut enim placeat corrupti qui repudiandae. Quod aperiam sint qui porro officia cum id omnis. Asperiores modi quaerat beatae quia qui et.".

/home/vagrant/code/intransportal/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php:363
/home/vagrant/code/intransportal/tests/Feature/ParticipateInForumTest.php:26

ERRORS!

Here is my ParticipateInForumTest.php


namespace Tests\Feature;

use Tests\TestCase;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class ParticipateInForumTest extends TestCase
{
    use DatabaseMigrations;    /**
     * A basic feature test example.
     *
     * @return void
     */
  function test_an_authenticated_user_can_pariticipate_inm_forum_threads() {
      $user = factory('App\User')->create();

      $this->be($user);
      $thread = factory('App\Thread')->create();
      $reply = factory('App\Reply')->make();

      $this->post($thread->path().'/replies', $reply->toArray());

      $this->get($thread->path())->assertSee($reply->body);
  }
}

Here is my Thread.php file


namespace App;

use Illuminate\Database\Eloquent\Model;

class Thread extends Model
{
    protected $guarded = [];
    public function path() {
        return "/forum/threads/" . $this->id;
    }

    public function replies() {
        return $this->hasMany(Reply::class);
    }

    public function creator()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function addReply($reply) {
        $this->replies->create($reply);
    }
}

And my reply controller:

<?php

namespace App\Http\Controllers;
use App\Thread;
use Auth;
use Illuminate\Http\Request;

class RepliesController extends Controller
{
    public function store(Thread $thread) {
        $thread->addReply([
            'body' => request('body'),
            'user_id' => Auth::user()->id
        ]);

        return back();
    }
}

Has anything changed after this video was posted? I followed the videos exactly so far, and a year ago when I was using earlier versions of the technologies, I had no problem. Thanks in advance

Sep
08
5 months ago
Activity icon

Commented on Initial Database Setup With Seeding

I followed the beginning of this series when Laravel 5.4 was released. I noticed that now in Laravel 5.8 the Model Factories are different. I opened up the UserFactories file and tried to add the three factories Jeffery created but when I run it in Tinker, I get a InvalidArgumentException with message 'Unable to locate factory with name [default] [App/Thread].' exception. What has changed?