public function testIndexOnLogined() { $this->getWithLogined('/user/pastebin')->assertResponseOk(); $all = $this->pasteBin->whereUserId($this->twitterId)->whereUserSn($this->twitterScreenName)->get(); foreach ($all as $pb) { $this->see($pb->description)->see($pb->code)->see("/pastebin/show/{$pb->hash}")->see("/user/pastebin/edit/{$pb->hash}")->see("/user/pastebin/delete/{$pb->hash}"); } }
/** * Index page (get). * * @Get("/", as="user.pastebin.index") * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function getIndex() { $all = $this->pasteBin->whereUserId($this->user_id)->whereUserSn($this->user_sn)->get()->reverse(); return view('user.pastebins.index', compact('all')); }