Projekt

Obecné

Profil

« Předchozí | Další » 

Revize cd149dd5

Přidáno uživatelem Ondřej Fibich před téměř 7 roky(ů)

Refs #1076: member expiration date calculation fix. The calc functionality was separate from Members controller to a new Expiration calc service. The new service comes with unit tests which tests the #1076. Additionally this patch comes with some fixes and improvements in already existing unit and integration tests.

Zobrazit rozdíly:

tests/application/helpers/dateTest.php
*/
class dateTest extends AbstractItCase
{
/**
* @covers date::create
*/
public function test_create()
{
$this->assertEquals('2017-01-01', date::create(1, 1, 2017));
$this->assertEquals('2017-12-01', date::create(1, 12, 2017));
$this->assertEquals('2017-01-31', date::create(31, 1, 2017));
}
/**
* @covers date::days_of_month
*/
public function test_days_of_month()
{
$this->assertEquals(31, date::days_of_month(1, 2017));
$this->assertEquals(28, date::days_of_month(2, 2014));
$this->assertEquals(28, date::days_of_month(2, 2015));
$this->assertEquals(29, date::days_of_month(2, 2016));
$this->assertEquals(28, date::days_of_month(2, 2017));
$this->assertEquals(31, date::days_of_month(3, 2017));
$this->assertEquals(30, date::days_of_month(4, 2017));
$this->assertEquals(31, date::days_of_month(5, 2017));
$this->assertEquals(30, date::days_of_month(6, 2017));
$this->assertEquals(31, date::days_of_month(7, 2017));
$this->assertEquals(31, date::days_of_month(8, 2017));
$this->assertEquals(30, date::days_of_month(9, 2017));
$this->assertEquals(31, date::days_of_month(10, 2017));
$this->assertEquals(30, date::days_of_month(11, 2017));
$this->assertEquals(31, date::days_of_month(12, 2017));
}
/**
* @covers date::get_next_deduct_date_to

Také k dispozici: Unified diff