File tree Expand file tree Collapse file tree 2 files changed +0
-35
lines changed Expand file tree Collapse file tree 2 files changed +0
-35
lines changed Original file line number Diff line number Diff line change @@ -24,28 +24,4 @@ public static function getHumanReadableSize($sizeInBytes)
2424
2525 return round ($ sizeInBytes , 2 ).' ' .$ units [$ i ];
2626 }
27-
28- /**
29- * @param bool $bool
30- *
31- * @return string
32- */
33- public static function getEmoji ($ bool )
34- {
35- if ($ bool ) {
36- return "\xe2\x9c\x85" ;
37- }
38-
39- return "\xe2\x9d\x8c" ;
40- }
41-
42- /**
43- * @param \Carbon\Carbon $date
44- *
45- * @return string
46- */
47- public static function ageInDays (Carbon $ date )
48- {
49- return number_format (round ($ date ->diffInMinutes () / (24 * 60 ), 2 ), 2 ).' ( ' .$ date ->diffForHumans ().') ' ;
50- }
5127}
Original file line number Diff line number Diff line change @@ -18,15 +18,4 @@ public function it_can_determine_a_human_readable_filesize()
1818 $ this ->assertEquals ('9.54 MB ' , Format::getHumanReadableSize (10000000 ));
1919 $ this ->assertEquals ('9.31 GB ' , Format::getHumanReadableSize (10000000000 ));
2020 }
21-
22- /** @test */
23- public function it_can_determine_the_age_in_days ()
24- {
25- Carbon::setTestNow (Carbon::create (2016 , 1 , 1 )->startOfDay ());
26-
27- $ this ->assertEquals ('0.00 (1 second ago) ' , Format::ageInDays (Carbon::now ()));
28- $ this ->assertEquals ('0.04 (1 hour ago) ' , Format::ageInDays (Carbon::now ()->subHour (1 )));
29- $ this ->assertEquals ('1.04 (1 day ago) ' , Format::ageInDays (Carbon::now ()->subHour (1 )->subDay (1 )));
30- $ this ->assertEquals ('30.04 (4 weeks ago) ' , Format::ageInDays (Carbon::now ()->subHour (1 )->subMonths (1 )));
31- }
3221}
You can’t perform that action at this time.
0 commit comments