/** * @dataProvider newDataProvider * * @param string $description * @param string $code * @param string $protect * @param string|null $user_id * @param string|null $user_sn */ public function testNew($description, $code, $protect, $user_id, $user_sn) { if (isset($user_id, $user_sn)) { $this->withSession(['twitter.login' => true, 'twitter.me.id' => $user_id, 'twitter.me.sn' => $user_sn]); } $this->visit('/pastebin/new')->see('New PasteBin')->see('/pastebin/new')->see('noindex,nofollow')->dontSee('index,follow')->assertResponseOk(); $this->see('Description')->type($description, 'description')->see('Code')->type($code, 'code')->see('Permission')->select($protect, 'protect')->see('Create')->press('Create!'); $hash = $this->pasteBin->whereDescription($description)->whereCode($code)->get()->first()->hash; $this->seePageIs("/pastebin/show/{$hash}")->see('作成が完了しました。')->assertResponseOk(); }