File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,6 @@ Security - in case of vulnerabilities.
1818
1919_ TBD_
2020
21- ### Changed
22- - Changed constraint to allow empty ranges, allowing you to use the end time exactly the same as the start time. ([ #18 ] ( ../../pull/19 ) ).
23-
2421## [ 0.4.0] 2018-02-16
2522
2623### Added
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ final class FiniteState extends RangeState
2626 */
2727 public function __construct (DateTimeInterface $ startDate , DateTimeInterface $ endDate )
2828 {
29- if ($ endDate < $ startDate ) {
29+ if ($ endDate <= $ startDate ) {
3030 throw new DateRangeException ('Invalid end date, must be after start ' );
3131 }
3232
Original file line number Diff line number Diff line change @@ -78,14 +78,12 @@ public function guardRangeSequence()
7878
7979 /**
8080 * @test
81- * @depends checkFiniteState
8281 */
83- public function rangeMayBeEmptyWhenEndsExactlyAtStart ()
82+ public function guardRangeDatesDifference ()
8483 {
85- $ subject = new FiniteState ($ this ->tomorrow , $ this ->tomorrow );
86- self ::assertTrue ($ subject ->hasStartDate ());
87- self ::assertTrue ($ subject ->hasEndDate ());
88- self ::assertSame ($ this ->tomorrow , $ subject ->getStartDate ());
89- self ::assertSame ($ this ->tomorrow , $ subject ->getEndDate ());
84+ $ this ->expectException (DateRangeException::class);
85+ $ this ->expectExceptionMessage ('Invalid end date, must be after start ' );
86+
87+ new FiniteState ($ this ->tomorrow , $ this ->tomorrow );
9088 }
9189}
You can’t perform that action at this time.
0 commit comments