enhanced plugin support (#634)

- refactored admin controller and templates
- plugin support for entity actions
- changed column mail to email in customer table
- refactored theme events
This commit is contained in:
Kevin Papst
2019-03-11 14:46:30 +01:00
committed by GitHub
parent 519be2d5a2
commit 3ac72a5c89
104 changed files with 1878 additions and 976 deletions

View File

@@ -0,0 +1,43 @@
<?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\Timesheet;
use App\Timesheet\Util;
use PHPUnit\Framework\TestCase;
/**
* @covers \App\Timesheet\Util
*/
class UtilTest extends TestCase
{
/**
* @dataProvider getRateCalculationData
*/
public function testCalculateRate($hourlyRate, $duration, $expectedRate)
{
$this->assertEquals($expectedRate, Util::calculateRate($hourlyRate, $duration));
}
public function getRateCalculationData()
{
yield [0, 0, 0];
yield [1, 100, 0.03];
yield [1, 900, 0.25];
yield [1, 1800, 0.5];
yield [10000, 1, 2.78];
yield [736, 123.45, 25.15];
yield [736, 123, 25.15];
yield [7360, 1234.99, 2522.84];
yield [7360, 1234, 2522.84];
yield [7360.34, 1234, 2522.96];
yield [7360.01, 1234, 2522.85];
yield [7360.99, 1234, 2523.18];
}
}