function postVote($self) { if (!$self) { // stuff } $motion = postMotion($self, ['status' => 2]); $vote = factory(App\Vote::class)->make(['motion_id' => $motion->id])->toArray(); $vote = $self->call('POST', '/api/vote/?token=' . $self->token, $vote); $self->assertResponseOk(); return $vote->getOriginalContent(); }
/** @test */ public function it_can_restore_a_motion() { $motion = postMotion($this); // Delete Motion $this->call('DELETE', '/api/motion/' . $motion->id . '?token=' . $this->token); $this->assertResponseOk(); $this->seeInDatabase('motions', ['deleted_at' => $motion->deleted_at]); // Restore motion $this->call('GET', '/api/motion/' . $motion->id . '/restore?token=' . $this->token); $this->assertResponseOk(); $this->seeInDatabase('motions', ['deleted_at' => null]); }