Some tests

This commit is contained in:
James Cole 2016-01-20 15:27:53 +01:00
parent c9e4a09da6
commit 441ba79ec7
2 changed files with 67 additions and 45 deletions

View File

@ -33,7 +33,7 @@ class TestDataSeeder extends Seeder
// create asset accounts for user #1. // create asset accounts for user #1.
$this->createAssetAccounts($user); $this->createAssetAccounts($user);
// create a bills for user #1 // create bills for user #1
$this->createBills($user); $this->createBills($user);
// create some budgets for user #1 // create some budgets for user #1

View File

@ -16,14 +16,12 @@ class BillControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\BillController::create * @covers FireflyIII\Http\Controllers\BillController::create
* @todo Implement testCreate().
*/ */
public function testCreate() public function testCreate()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills/create');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
@ -32,93 +30,117 @@ class BillControllerTest extends TestCase
*/ */
public function testDelete() public function testDelete()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills/delete/1');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::destroy * @covers FireflyIII\Http\Controllers\BillController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $this->session(['bills.delete.url' => 'http://localhost']);
$this->markTestIncomplete( $this->be($this->user());
'This test has not been implemented yet.' $args = [
); '_token' => Session::token(),
];
$response = $this->call('POST', '/bills/destroy/2', $args);
$this->assertSessionHas('success');
$this->assertEquals(302, $response->status());
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::edit * @covers FireflyIII\Http\Controllers\BillController::edit
* @todo Implement testEdit().
*/ */
public function testEdit() public function testEdit()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills/edit/1');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::index * @covers FireflyIII\Http\Controllers\BillController::index
* @todo Implement testIndex().
*/ */
public function testIndex() public function testIndex()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::rescan * @covers FireflyIII\Http\Controllers\BillController::rescan
* @todo Implement testRescan().
*/ */
public function testRescan() public function testRescan()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills/rescan/1');
'This test has not been implemented yet.' $this->assertSessionHas('success');
); $this->assertEquals(302, $response->status());
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::show * @covers FireflyIII\Http\Controllers\BillController::show
* @todo Implement testShow().
*/ */
public function testShow() public function testShow()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/bills/show/1');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\BillController::store * @covers FireflyIII\Http\Controllers\BillController::store
* @todo Implement testStore().
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $this->session(['bills.create.url' => 'http://localhost']);
$this->markTestIncomplete( $args = [
'This test has not been implemented yet.' 'name' => 'Some test',
); 'match' => 'words',
'_token' => Session::token(),
'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 * @covers FireflyIII\Http\Controllers\BillController::update
* @todo Implement testUpdate().
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $this->session(['bills.edit.url' => 'http://localhost']);
$this->markTestIncomplete( $args = [
'This test has not been implemented yet.' 'id' => 1,
); 'name' => 'Some test',
'match' => 'words',
'_token' => Session::token(),
'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());
} }
} }