Remove unrelated code style change.

This commit is contained in:
Pol Dellaiera
2021-03-31 14:57:25 +02:00
parent 48e2d2ceab
commit 03243605da
3 changed files with 83 additions and 79 deletions

View File

@@ -2,8 +2,8 @@
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -35,55 +35,55 @@ use Generator;
class PersonTest extends \PHPUnit\Framework\TestCase
{
/**
* Test the creation of an accompanying, its closure and the access to
* Test the creation of an accompanying, its closure and the access to
* the current accompaniying period via the getCurrentAccompanyingPeriod
* function.
*/
public function testGetCurrentAccompanyingPeriod()
{
$d = new \DateTime('yesterday');
$d = new \DateTime('yesterday');
$p = new Person($d);
$period = $p->getCurrentAccompanyingPeriod();
$this->assertInstanceOf('Chill\PersonBundle\Entity\AccompanyingPeriod', $period);
$this->assertTrue($period->isOpen());
$this->assertEquals($d, $period->getOpeningDate());
//close and test
$period->setClosingDate(new \DateTime('tomorrow'));
$shouldBeNull = $p->getCurrentAccompanyingPeriod();
$this->assertNull($shouldBeNull);
}
/**
* Test if the getAccompanyingPeriodsOrdered function return a list of
* periods ordered ascendency.
*/
public function testAccompanyingPeriodOrderWithUnorderedAccompanyingPeriod()
{
{
$d = new \DateTime("2013/2/1");
$p = new Person($d);
$e = new \DateTime("2013/3/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
$p->close($period);
$f = new \DateTime("2013/1/1");
$p->open(new AccompanyingPeriod($f));
$g = new \DateTime("2013/4/1");
$g = new \DateTime("2013/4/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
$p->close($period);
$r = $p->getAccompanyingPeriodsOrdered();
$date = $r[0]->getOpeningDate()->format('Y-m-d');
$this->assertEquals($date, '2013-01-01');
}
/**
* Test if the getAccompanyingPeriodsOrdered function, for periods
* starting at the same time order regarding to the closing date.
@@ -91,25 +91,25 @@ class PersonTest extends \PHPUnit\Framework\TestCase
public function testAccompanyingPeriodOrderSameDateOpening() {
$d = new \DateTime("2013/2/1");
$p = new Person($d);
$g = new \DateTime("2013/4/1");
$g = new \DateTime("2013/4/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
$p->close($period);
$f = new \DateTime("2013/2/1");
$p->open(new AccompanyingPeriod($f));
$e = new \DateTime("2013/3/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
$p->close($period);
$r = $p->getAccompanyingPeriodsOrdered();
$date = $r[0]->getClosingDate()->format('Y-m-d');
$this->assertEquals($date, '2013-03-01');
}
/**
* Test if the function checkAccompanyingPeriodIsNotCovering returns
* the good constant when two periods are collapsing : a period
@@ -118,23 +118,23 @@ class PersonTest extends \PHPUnit\Framework\TestCase
public function testDateCoveringWithCoveringAccompanyingPeriod() {
$d = new \DateTime("2013/2/1");
$p = new Person($d);
$e = new \DateTime("2013/3/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
$p->close($period);
$f = new \DateTime("2013/1/1");
$p->open(new AccompanyingPeriod($f));
$g = new \DateTime("2013/4/1");
$g = new \DateTime("2013/4/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($g);
$p->close($period);
$r = $p->checkAccompanyingPeriodsAreNotCollapsing();
$this->assertEquals($r['result'], Person::ERROR_PERIODS_ARE_COLLAPSING);
}
/**
* Test if the function checkAccompanyingPeriodIsNotCovering returns
* the good constant when two periods are collapsing : a period is open
@@ -143,16 +143,16 @@ class PersonTest extends \PHPUnit\Framework\TestCase
public function testNotOpenAFileReOpenedLater() {
$d = new \DateTime("2013/2/1");
$p = new Person($d);
$e = new \DateTime("2013/3/1");
$period = $p->getCurrentAccompanyingPeriod()->setClosingDate($e);
$p->close($period);
$f = new \DateTime("2013/1/1");
$p->open(new AccompanyingPeriod($f));
$r = $p->checkAccompanyingPeriodsAreNotCollapsing();
$this->assertEquals($r['result'], Person::ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD);
}