be($this->user()); $this->call('GET', '/profile/change-password'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\ProfileController::deleteAccount */ public function testDeleteAccount() { $this->be($this->user()); $this->call('GET', '/profile/delete-account'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\ProfileController::index */ public function testIndex() { $this->be($this->user()); $this->call('GET', '/profile'); $this->assertResponseStatus(200); } /** * @covers FireflyIII\Http\Controllers\ProfileController::postChangePassword * @covers FireflyIII\Http\Requests\ProfileFormRequest::authorize * @covers FireflyIII\Http\Requests\ProfileFormRequest::rules */ public function testPostChangePassword() { $args = [ 'current_password' => 'james', 'new_password' => 'sander', 'new_password_confirmation' => 'sander', ]; $this->be($this->user()); $this->call('POST', '/profile/change-password', $args); $this->assertResponseStatus(302); $this->assertSessionHas('success'); } /** * @covers FireflyIII\Http\Controllers\ProfileController::postDeleteAccount * @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::authorize * @covers FireflyIII\Http\Requests\DeleteAccountFormRequest::rules */ public function testPostDeleteAccount() { $args = [ 'password' => 'james', ]; $this->be($this->toBeDeletedUser()); $this->call('POST', '/profile/delete-account', $args); $this->assertResponseStatus(302); $this->assertRedirectedToRoute('index'); $this->assertNull(DB::table('users')->find(3)); } }