Some new tests

This commit is contained in:
James Cole
2016-01-23 16:48:34 +01:00
parent 99d14e8cbe
commit 935dc3ff9f
2 changed files with 74 additions and 45 deletions

View File

@@ -16,97 +16,116 @@ class CurrencyControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::create * @covers FireflyIII\Http\Controllers\CurrencyController::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', '/currency/create');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::defaultCurrency * @covers FireflyIII\Http\Controllers\CurrencyController::defaultCurrency
* @todo Implement testDefaultCurrency().
*/ */
public function testDefaultCurrency() public function testDefaultCurrency()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $response = $this->call('GET', '/currency/default/2');
'This test has not been implemented yet.' $this->assertEquals(302, $response->status());
); $this->assertRedirectedToRoute('currency.index');
$this->assertSessionHas('success');
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::delete * @covers FireflyIII\Http\Controllers\CurrencyController::delete
* @todo Implement testDelete().
*/ */
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', '/currency/delete/2');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::destroy * @covers FireflyIII\Http\Controllers\CurrencyController::destroy
* @todo Implement testDestroy().
*/ */
public function testDestroy() public function testDestroy()
{ {
// Remove the following lines when you implement this test. $args = [
$this->markTestIncomplete( '_token' => Session::token(),
'This test has not been implemented yet.' ];
);
$this->session(['currency.delete.url' => 'http://localhost/currency']);
$this->be($this->user());
$response = $this->call('POST', '/currency/destroy/3', $args);
$this->assertSessionHas('success');
$this->assertRedirectedToRoute('currency.index');
$this->assertEquals(302, $response->status());
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::edit * @covers FireflyIII\Http\Controllers\CurrencyController::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', '/currency/edit/2');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::index * @covers FireflyIII\Http\Controllers\CurrencyController::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', '/currency');
'This test has not been implemented yet.' $this->assertEquals(200, $response->status());
);
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::store * @covers FireflyIII\Http\Controllers\CurrencyController::store
* @todo Implement testStore().
*/ */
public function testStore() public function testStore()
{ {
// Remove the following lines when you implement this test. $this->be($this->user());
$this->markTestIncomplete( $this->session(['currency.create.url' => 'http://localhost/currency']);
'This test has not been implemented yet.' $args = [
); '_token' => Session::token(),
'name' => 'New Euro.',
'symbol' => 'Y',
'code' => 'IUY',
];
$response = $this->call('POST', '/currency/store', $args);
$this->assertEquals(302, $response->status());
$this->assertSessionHas('success');
$this->assertRedirectedToRoute('currency.index');
} }
/** /**
* @covers FireflyIII\Http\Controllers\CurrencyController::update * @covers FireflyIII\Http\Controllers\CurrencyController::update
* @todo Implement testUpdate().
*/ */
public function testUpdate() public function testUpdate()
{ {
// Remove the following lines when you implement this test. $this->session(['currency.edit.url' => 'http://localhost/currency']);
$this->markTestIncomplete(
'This test has not been implemented yet.' $args = [
); 'id' => 1,
'name' => 'New Euro.',
'symbol' => 'Y',
'code' => 'IUY',
'_token' => Session::token(),
];
$this->be($this->user());
$response = $this->call('POST', '/currency/update/1', $args);
$this->assertEquals(302, $response->status());
$this->assertSessionHas('success');
$this->assertRedirectedToRoute('currency.index');
} }
} }

View File

@@ -16,13 +16,23 @@ class HelpControllerTest extends TestCase
/** /**
* @covers FireflyIII\Http\Controllers\HelpController::show * @covers FireflyIII\Http\Controllers\HelpController::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', '/help/index');
'This test has not been implemented yet.'
); $this->assertEquals(200, $response->status());
}
/**
* @covers FireflyIII\Http\Controllers\HelpController::show
*/
public function testShowNoRoute()
{
$this->be($this->user());
$response = $this->call('GET', '/help/indxxex');
$this->assertEquals(200, $response->status());
} }
} }