LagTest.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of the Carbon package.
  5. *
  6. * (c) Brian Nesbitt <brian@nesbot.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Tests\Localization;
  12. /**
  13. * @group localization
  14. */
  15. class LagTest extends LocalizationTestCase
  16. {
  17. public const LOCALE = 'lag'; // Langi
  18. public const CASES = [
  19. // Carbon::parse('2018-01-04 00:00:00')->addDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  20. 'Tomorrow at 00:00',
  21. // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  22. 'Jumamóosi at 00:00',
  23. // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  24. 'Jumapíiri at 00:00',
  25. // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  26. 'Jumatátu at 00:00',
  27. // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  28. 'Jumaíne at 00:00',
  29. // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  30. 'Jumatáano at 00:00',
  31. // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00'))
  32. 'Alamíisi at 00:00',
  33. // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00'))
  34. 'Ijumáa at 00:00',
  35. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  36. 'Jumaíne at 00:00',
  37. // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  38. 'Jumatáano at 00:00',
  39. // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  40. 'Alamíisi at 00:00',
  41. // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  42. 'Ijumáa at 00:00',
  43. // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  44. 'Jumamóosi at 00:00',
  45. // Carbon::now()->subDays(2)->calendar()
  46. 'Last Jumapíiri at 20:49',
  47. // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  48. 'Yesterday at 22:00',
  49. // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00'))
  50. 'Today at 10:00',
  51. // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  52. 'Today at 02:00',
  53. // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00'))
  54. 'Tomorrow at 01:00',
  55. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  56. 'Jumaíne at 00:00',
  57. // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00'))
  58. 'Yesterday at 00:00',
  59. // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  60. 'Yesterday at 00:00',
  61. // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  62. 'Last Jumaíne at 00:00',
  63. // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  64. 'Last Jumatátu at 00:00',
  65. // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  66. 'Last Jumapíiri at 00:00',
  67. // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  68. 'Last Jumamóosi at 00:00',
  69. // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  70. 'Last Ijumáa at 00:00',
  71. // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00'))
  72. 'Last Alamíisi at 00:00',
  73. // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00'))
  74. 'Last Jumatáano at 00:00',
  75. // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  76. 'Last Ijumáa at 00:00',
  77. // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo')
  78. '1st 1st 1st 1st 1st',
  79. // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo')
  80. '2nd 1st',
  81. // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo')
  82. '3rd 1st',
  83. // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo')
  84. '4th 1st',
  85. // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo')
  86. '5th 1st',
  87. // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo')
  88. '6th 1st',
  89. // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo')
  90. '7th 1st',
  91. // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo')
  92. '11th 2nd',
  93. // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo')
  94. '40th',
  95. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo')
  96. '41st',
  97. // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo')
  98. '100th',
  99. // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z')
  100. '12:00 too CET',
  101. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a')
  102. '12:00 TOO, 12:00 too',
  103. // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a')
  104. '1:30 TOO, 1:30 too',
  105. // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a')
  106. '2:00 TOO, 2:00 too',
  107. // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a')
  108. '6:00 TOO, 6:00 too',
  109. // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a')
  110. '10:00 TOO, 10:00 too',
  111. // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a')
  112. '12:00 MUU, 12:00 muu',
  113. // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a')
  114. '5:00 MUU, 5:00 muu',
  115. // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a')
  116. '9:30 MUU, 9:30 muu',
  117. // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a')
  118. '11:00 MUU, 11:00 muu',
  119. // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
  120. '0th',
  121. // Carbon::now()->subSeconds(1)->diffForHumans()
  122. '1 second ago',
  123. // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
  124. '1s ago',
  125. // Carbon::now()->subSeconds(2)->diffForHumans()
  126. '2 seconds ago',
  127. // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
  128. '2s ago',
  129. // Carbon::now()->subMinutes(1)->diffForHumans()
  130. '1 minute ago',
  131. // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
  132. '1m ago',
  133. // Carbon::now()->subMinutes(2)->diffForHumans()
  134. '2 minutes ago',
  135. // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
  136. '2m ago',
  137. // Carbon::now()->subHours(1)->diffForHumans()
  138. '1 hour ago',
  139. // Carbon::now()->subHours(1)->diffForHumans(null, false, true)
  140. '1h ago',
  141. // Carbon::now()->subHours(2)->diffForHumans()
  142. '2 hours ago',
  143. // Carbon::now()->subHours(2)->diffForHumans(null, false, true)
  144. '2h ago',
  145. // Carbon::now()->subDays(1)->diffForHumans()
  146. '1 day ago',
  147. // Carbon::now()->subDays(1)->diffForHumans(null, false, true)
  148. '1d ago',
  149. // Carbon::now()->subDays(2)->diffForHumans()
  150. '2 days ago',
  151. // Carbon::now()->subDays(2)->diffForHumans(null, false, true)
  152. '2d ago',
  153. // Carbon::now()->subWeeks(1)->diffForHumans()
  154. '1 week ago',
  155. // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
  156. '1w ago',
  157. // Carbon::now()->subWeeks(2)->diffForHumans()
  158. '2 weeks ago',
  159. // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
  160. '2w ago',
  161. // Carbon::now()->subMonths(1)->diffForHumans()
  162. '1 month ago',
  163. // Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
  164. '1mo ago',
  165. // Carbon::now()->subMonths(2)->diffForHumans()
  166. '2 months ago',
  167. // Carbon::now()->subMonths(2)->diffForHumans(null, false, true)
  168. '2mos ago',
  169. // Carbon::now()->subYears(1)->diffForHumans()
  170. '1 year ago',
  171. // Carbon::now()->subYears(1)->diffForHumans(null, false, true)
  172. '1yr ago',
  173. // Carbon::now()->subYears(2)->diffForHumans()
  174. '2 years ago',
  175. // Carbon::now()->subYears(2)->diffForHumans(null, false, true)
  176. '2yrs ago',
  177. // Carbon::now()->addSecond()->diffForHumans()
  178. '1 second from now',
  179. // Carbon::now()->addSecond()->diffForHumans(null, false, true)
  180. '1s from now',
  181. // Carbon::now()->addSecond()->diffForHumans(Carbon::now())
  182. '1 second after',
  183. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
  184. '1s after',
  185. // Carbon::now()->diffForHumans(Carbon::now()->addSecond())
  186. '1 second before',
  187. // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
  188. '1s before',
  189. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
  190. '1 second',
  191. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
  192. '1s',
  193. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
  194. '2 seconds',
  195. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
  196. '2s',
  197. // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
  198. '1s from now',
  199. // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
  200. '1 minute 1 second',
  201. // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
  202. '2yrs 3mos 1d 1s',
  203. // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
  204. '3 years from now',
  205. // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
  206. '5mos ago',
  207. // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
  208. '2yrs 3mos 1d 1s ago',
  209. // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
  210. '1 week 10 hours',
  211. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  212. '1 week 6 days',
  213. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  214. '1 week 6 days',
  215. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
  216. '1 week and 6 days from now',
  217. // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
  218. '2 weeks 1 hour',
  219. // Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
  220. 'an hour from now',
  221. // CarbonInterval::days(2)->forHumans()
  222. '2 days',
  223. // CarbonInterval::create('P1DT3H')->forHumans(true)
  224. '1d 3h',
  225. ];
  226. }