2016-11-19 20:30:30 +01:00
|
|
|
<?php
|
2016-12-06 09:16:36 +01:00
|
|
|
/**
|
|
|
|
* JsonControllerTest.php
|
|
|
|
* Copyright (C) 2016 thegrumpydictator@gmail.com
|
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International License.
|
|
|
|
*
|
|
|
|
* See the LICENSE file for details.
|
|
|
|
*/
|
2016-11-19 20:30:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2016-12-10 06:54:50 +01:00
|
|
|
* Generated by PHPUnit_SkeletonGenerator on 2016-12-10 at 05:51:42.
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
class JsonControllerTest extends TestCase
|
|
|
|
{
|
2016-11-20 07:24:18 +01:00
|
|
|
|
2016-11-19 20:30:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
|
|
* This method is called before a test is executed.
|
|
|
|
*/
|
|
|
|
public function setUp()
|
|
|
|
{
|
2016-11-20 08:30:25 +01:00
|
|
|
parent::setUp();
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
2016-12-07 19:53:41 +01:00
|
|
|
/**
|
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::action
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testAction()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.action'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::boxBillsPaid
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testBoxBillsPaid()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.box.paid'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::boxBillsUnpaid
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testBoxBillsUnpaid()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.box.unpaid'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::boxIn
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testBoxIn()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.box.in'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::boxOut
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testBoxOut()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.box.out'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::categories
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testCategories()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.categories'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::endTour
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testEndTour()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('post', route('json.end-tour'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::expenseAccounts
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testExpenseAccounts()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.expense-accounts'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::revenueAccounts
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testRevenueAccounts()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.revenue-accounts'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::tags
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testTags()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.tags'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::tour
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testTour()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.tour'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::transactionJournals
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testTransactionJournals()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.transaction-journals', ['deposit']));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-07 19:53:41 +01:00
|
|
|
* @covers \FireflyIII\Http\Controllers\JsonController::trigger
|
2016-11-19 20:30:30 +01:00
|
|
|
*/
|
|
|
|
public function testTrigger()
|
|
|
|
{
|
2016-12-18 10:37:59 +01:00
|
|
|
$this->be($this->user());
|
|
|
|
$this->call('get', route('json.trigger'));
|
|
|
|
$this->assertResponseStatus(200);
|
2016-12-10 06:54:50 +01:00
|
|
|
}
|
2016-11-19 20:30:30 +01:00
|
|
|
}
|