improved invoices with new renderer (#306)
* added docx renderer and demo template * added csv renderer and demo template * added xlsx renderer and demo template * added ods renderer and demo template * added user calculator * added invoice documentation
This commit is contained in:
42
tests/Model/DashboardSectionTest.php
Normal file
42
tests/Model/DashboardSectionTest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Kimai time-tracking app.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Tests\Model;
|
||||
|
||||
use App\Model\DashboardSection;
|
||||
use App\Model\Widget;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers \App\Model\DashboardSection
|
||||
*/
|
||||
class DashboardSectionTest extends TestCase
|
||||
{
|
||||
public function testDefaultValues()
|
||||
{
|
||||
$sut = new DashboardSection('test');
|
||||
$this->assertEquals('test', $sut->getTitle());
|
||||
$this->assertEquals(0, $sut->getOrder());
|
||||
$this->assertEquals([], $sut->getWidgets());
|
||||
$this->assertEquals(DashboardSection::TYPE_SIMPLE, $sut->getType());
|
||||
}
|
||||
|
||||
public function testSetter()
|
||||
{
|
||||
$sut = new DashboardSection('hello-world');
|
||||
$sut->setType(DashboardSection::TYPE_CHART);
|
||||
$sut->setOrder(13);
|
||||
$sut->addWidget(new Widget('bar', []));
|
||||
|
||||
$this->assertCount(1, $sut->getWidgets());
|
||||
$this->assertEquals(DashboardSection::TYPE_CHART, $sut->getType());
|
||||
$this->assertEquals(13, $sut->getOrder());
|
||||
$this->assertEquals('bar', $sut->getWidgets()[0]->getTitle());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user