/** * @test */ public function it_fetches_collection_by_column() { $title = 'a super funky title'; factory(Post::class, 8)->create(); $requiredPosts = factory(Post::class, 2)->create(['title' => $title]); $posts = $this->posts->getCollectionByColumn($title, 'title'); $this->assertEquals($requiredPosts->first()->id, $posts->first()->id); }