be($this->user()); $response = $this->call('GET', '/bills/create'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::delete * @todo Implement testDelete(). */ public function testDelete() { $this->be($this->user()); $response = $this->call('GET', '/bills/delete/1'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::destroy */ public function testDestroy() { $this->session(['bills.delete.url' => 'http://localhost']); $this->be($this->user()); $response = $this->call('POST', '/bills/destroy/2'); $this->assertSessionHas('success'); $this->assertEquals(302, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::edit */ public function testEdit() { $this->be($this->user()); $response = $this->call('GET', '/bills/edit/1'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::index */ public function testIndex() { $this->be($this->user()); $response = $this->call('GET', '/bills'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::rescan */ public function testRescan() { $this->be($this->user()); $response = $this->call('GET', '/bills/rescan/1'); $this->assertSessionHas('success'); $this->assertEquals(302, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::show */ public function testShow() { $this->be($this->user()); $response = $this->call('GET', '/bills/show/1'); $this->assertEquals(200, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::store */ public function testStore() { $this->session(['bills.create.url' => 'http://localhost']); $args = [ 'name' => 'Some test', 'match' => 'words', 'amount_min' => 10, 'amount_max' => 100, 'amount_currency_id_amount_min' => 1, 'amount_currency_id_amount_max' => 1, 'date' => '20160101', 'repeat_freq' => 'monthly', 'skip' => 0, ]; $this->be($this->user()); $response = $this->call('POST', '/bills/store', $args); $this->assertSessionHas('success'); $this->assertEquals(302, $response->status()); } /** * @covers FireflyIII\Http\Controllers\BillController::update */ public function testUpdate() { $this->session(['bills.edit.url' => 'http://localhost']); $args = [ 'id' => 1, 'name' => 'Some test', 'match' => 'words', 'amount_min' => 10, 'amount_max' => 100, 'amount_currency_id_amount_min' => 1, 'amount_currency_id_amount_max' => 1, 'date' => '20160101', 'repeat_freq' => 'monthly', 'skip' => 0, ]; $this->be($this->user()); $response = $this->call('POST', '/bills/update/1', $args); $this->assertSessionHas('success'); $this->assertEquals(302, $response->status()); } }