firefly-iii/tests/repositories/BillRepositoryTest.php

198 lines
5.5 KiB
PHP
Raw Normal View History

2015-05-08 05:44:42 -05:00
<?php
2015-05-08 05:50:39 -05:00
use Carbon\Carbon;
use FireflyIII\Models\Bill;
2015-05-08 05:44:42 -05:00
use FireflyIII\Repositories\Bill\BillRepository;
2015-05-08 05:50:39 -05:00
use League\FactoryMuffin\Facade as FactoryMuffin;
2015-05-08 05:44:42 -05:00
/**
* Generated by PHPUnit_SkeletonGenerator on 2015-05-08 at 10:43:42.
*/
class BillRepositoryTest extends TestCase
{
/**
* @var BillRepository
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
public function setUp()
{
$this->object = new BillRepository;
parent::setUp();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
public function tearDown()
{
parent::tearDown();
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::createFakeBill
*/
public function testCreateFakeBill()
{
2015-05-08 05:50:39 -05:00
$description = 'Fake bill ' . rand(10, 100);
$date = new Carbon('2013-01-01');
$amount = 1200;
$bill = $this->object->createFakeBill($description, $date, $amount);
$this->assertEquals($amount, $bill->amount_max);
$this->assertEquals($amount, $bill->amount_min);
$this->assertNull($bill->id);
$this->assertEquals($description, $bill->name);
2015-05-08 05:44:42 -05:00
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::destroy
*/
public function testDestroy()
{
2015-05-08 05:50:39 -05:00
$bill = FactoryMuffin::create('FireflyIII\Models\Bill');
$id = $bill->id;
$this->object->destroy($bill);
// cannot find bill:
$this->assertCount(0, Bill::whereId($id)->whereNotNull('deleted_at')->get());
2015-05-08 05:44:42 -05:00
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getActiveBills
* @todo Implement testGetActiveBills().
*/
public function testGetActiveBills()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getBills
* @todo Implement testGetBills().
*/
public function testGetBills()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getJournals
* @todo Implement testGetJournals().
*/
public function testGetJournals()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getJournalsInRange
* @todo Implement testGetJournalsInRange().
*/
public function testGetJournalsInRange()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getPossiblyRelatedJournals
* @todo Implement testGetPossiblyRelatedJournals().
*/
public function testGetPossiblyRelatedJournals()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::getRanges
* @todo Implement testGetRanges().
*/
public function testGetRanges()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::lastFoundMatch
* @todo Implement testLastFoundMatch().
*/
public function testLastFoundMatch()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::nextExpectedMatch
* @todo Implement testNextExpectedMatch().
*/
public function testNextExpectedMatch()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::scan
* @todo Implement testScan().
*/
public function testScan()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::store
* @todo Implement testStore().
*/
public function testStore()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers FireflyIII\Repositories\Bill\BillRepository::update
* @todo Implement testUpdate().
*/
public function testUpdate()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
}