@@ -62,29 +62,23 @@ function let(Translator $translator)
6262 )->willReturn ('через 10 дней, 5 часов ' );
6363 }
6464
65- function it_format_compound_datetime_diff (PreciseDifference $ diff , CompoundResult $ dayResult ,
66- CompoundResult $ hourResult )
65+ function it_format_compound_datetime_diff ()
6766 {
68- $ dayResult -> getUnit ()-> willReturn ( new Day ());
69- $ dayResult -> getQuantity ()-> willReturn ( 10 );
70- $ hourResult -> getUnit ()-> willReturn ( new Hour ());
71- $ hourResult -> getQuantity ()-> willReturn ( 5 );
67+ $ diff = new PreciseDifference (
68+ new \ DateTime ( " 2015-01-01 00:00:00 " ),
69+ new \ DateTime ( " 2015-01-11 05:00:00 " )
70+ );
7271
73- $ diff ->getCompoundResults ()->willReturn (array ($ dayResult , $ hourResult ));
74- $ diff ->isPast ()->willReturn (false );
7572 $ this ->formatDifference ($ diff )->shouldReturn ('10 days, 5 hours from now ' );
7673 }
7774
78- function it_format_compound_datetime_diff_for_specific_locale (PreciseDifference $ diff ,
79- CompoundResult $ dayResult , CompoundResult $ hourResult )
75+ function it_format_compound_datetime_diff_for_specific_locale ()
8076 {
81- $ dayResult ->getUnit ()->willReturn (new Day ());
82- $ dayResult ->getQuantity ()->willReturn (10 );
83- $ hourResult ->getUnit ()->willReturn (new Hour ());
84- $ hourResult ->getQuantity ()->willReturn (5 );
85-
86- $ diff ->getCompoundResults ()->willReturn (array ($ dayResult , $ hourResult ));
87- $ diff ->isPast ()->willReturn (false );
77+ $ diff = new PreciseDifference (
78+ new \DateTime ("2015-01-01 00:00:00 " ),
79+ new \DateTime ("2015-01-11 05:00:00 " )
80+ );
81+
8882 $ this ->formatDifference ($ diff , 'ru ' )->shouldReturn ('через 10 дней, 5 часов ' );
8983 }
9084}
0 commit comments