public function createPost($owner) { $data = ['user_id' => $owner, 'title' => 'my title', 'body' => 'This is the body', 'type' => 'text']; return Groups::createPost($data); }
/** @test **/ public function it_can_count_user_posts() { $this->post2 = Groups::createPost($this->data); $user = Musonza\Groups\Models\User::find(1); $this->assertEquals(2, $user->posts->count()); }