NiuTest.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 NiuTest extends LocalizationTestCase
  16. {
  17. public const LOCALE = 'niu'; // Niuean
  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 12:00 AM',
  21. // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  22. 'Aho Faiumu at 12:00 AM',
  23. // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  24. 'Aho Tapu at 12:00 AM',
  25. // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  26. 'Aho Gofua at 12:00 AM',
  27. // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  28. 'Aho Ua at 12:00 AM',
  29. // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  30. 'Aho Lotu at 12:00 AM',
  31. // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00'))
  32. 'Aho Tuloto at 12:00 AM',
  33. // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00'))
  34. 'Aho Falaile at 12:00 AM',
  35. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  36. 'Aho Ua at 12:00 AM',
  37. // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  38. 'Aho Lotu at 12:00 AM',
  39. // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  40. 'Aho Tuloto at 12:00 AM',
  41. // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  42. 'Aho Falaile at 12:00 AM',
  43. // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  44. 'Aho Faiumu at 12:00 AM',
  45. // Carbon::now()->subDays(2)->calendar()
  46. 'Last Aho Tapu at 8:49 PM',
  47. // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  48. 'Yesterday at 10:00 PM',
  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 AM',
  51. // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  52. 'Today at 2:00 AM',
  53. // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00'))
  54. 'Tomorrow at 1:00 AM',
  55. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  56. 'Aho Ua at 12:00 AM',
  57. // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00'))
  58. 'Yesterday at 12:00 AM',
  59. // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  60. 'Yesterday at 12:00 AM',
  61. // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  62. 'Last Aho Ua at 12:00 AM',
  63. // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  64. 'Last Aho Gofua at 12:00 AM',
  65. // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  66. 'Last Aho Tapu at 12:00 AM',
  67. // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  68. 'Last Aho Faiumu at 12:00 AM',
  69. // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  70. 'Last Aho Falaile at 12:00 AM',
  71. // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00'))
  72. 'Last Aho Tuloto at 12:00 AM',
  73. // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00'))
  74. 'Last Aho Lotu at 12:00 AM',
  75. // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  76. 'Last Aho Falaile at 12:00 AM',
  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 am CET',
  101. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a')
  102. '12:00 AM, 12:00 am',
  103. // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a')
  104. '1:30 AM, 1:30 am',
  105. // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a')
  106. '2:00 AM, 2:00 am',
  107. // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a')
  108. '6:00 AM, 6:00 am',
  109. // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a')
  110. '10:00 AM, 10:00 am',
  111. // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a')
  112. '12:00 PM, 12:00 pm',
  113. // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a')
  114. '5:00 PM, 5:00 pm',
  115. // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a')
  116. '9:30 PM, 9:30 pm',
  117. // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a')
  118. '11:00 PM, 11:00 pm',
  119. // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
  120. '0th',
  121. // Carbon::now()->subSeconds(1)->diffForHumans()
  122. '1 sekone ago',
  123. // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
  124. '1 sekone ago',
  125. // Carbon::now()->subSeconds(2)->diffForHumans()
  126. '2 sekone ago',
  127. // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
  128. '2 sekone ago',
  129. // Carbon::now()->subMinutes(1)->diffForHumans()
  130. '1 minuti ago',
  131. // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
  132. '1 minuti ago',
  133. // Carbon::now()->subMinutes(2)->diffForHumans()
  134. '2 minuti ago',
  135. // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
  136. '2 minuti ago',
  137. // Carbon::now()->subHours(1)->diffForHumans()
  138. '1 e tulā ago',
  139. // Carbon::now()->subHours(1)->diffForHumans(null, false, true)
  140. '1 e tulā ago',
  141. // Carbon::now()->subHours(2)->diffForHumans()
  142. '2 e tulā ago',
  143. // Carbon::now()->subHours(2)->diffForHumans(null, false, true)
  144. '2 e tulā ago',
  145. // Carbon::now()->subDays(1)->diffForHumans()
  146. '1 aho ago',
  147. // Carbon::now()->subDays(1)->diffForHumans(null, false, true)
  148. '1 aho ago',
  149. // Carbon::now()->subDays(2)->diffForHumans()
  150. '2 aho ago',
  151. // Carbon::now()->subDays(2)->diffForHumans(null, false, true)
  152. '2 aho ago',
  153. // Carbon::now()->subWeeks(1)->diffForHumans()
  154. '1 faahi tapu ago',
  155. // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
  156. '1 faahi tapu ago',
  157. // Carbon::now()->subWeeks(2)->diffForHumans()
  158. '2 faahi tapu ago',
  159. // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
  160. '2 faahi tapu ago',
  161. // Carbon::now()->subMonths(1)->diffForHumans()
  162. '1 mahina ago',
  163. // Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
  164. '1 mahina ago',
  165. // Carbon::now()->subMonths(2)->diffForHumans()
  166. '2 mahina ago',
  167. // Carbon::now()->subMonths(2)->diffForHumans(null, false, true)
  168. '2 mahina ago',
  169. // Carbon::now()->subYears(1)->diffForHumans()
  170. '1 tau ago',
  171. // Carbon::now()->subYears(1)->diffForHumans(null, false, true)
  172. '1 tau ago',
  173. // Carbon::now()->subYears(2)->diffForHumans()
  174. '2 tau ago',
  175. // Carbon::now()->subYears(2)->diffForHumans(null, false, true)
  176. '2 tau ago',
  177. // Carbon::now()->addSecond()->diffForHumans()
  178. '1 sekone from now',
  179. // Carbon::now()->addSecond()->diffForHumans(null, false, true)
  180. '1 sekone from now',
  181. // Carbon::now()->addSecond()->diffForHumans(Carbon::now())
  182. '1 sekone after',
  183. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
  184. '1 sekone after',
  185. // Carbon::now()->diffForHumans(Carbon::now()->addSecond())
  186. '1 sekone before',
  187. // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
  188. '1 sekone before',
  189. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
  190. '1 sekone',
  191. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
  192. '1 sekone',
  193. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
  194. '2 sekone',
  195. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
  196. '2 sekone',
  197. // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
  198. '1 sekone from now',
  199. // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
  200. '1 minuti 1 sekone',
  201. // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
  202. '2 tau 3 mahina 1 aho 1 sekone',
  203. // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
  204. '3 tau from now',
  205. // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
  206. '5 mahina ago',
  207. // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
  208. '2 tau 3 mahina 1 aho 1 sekone ago',
  209. // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
  210. '1 faahi tapu 10 e tulā',
  211. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  212. '1 faahi tapu 6 aho',
  213. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  214. '1 faahi tapu 6 aho',
  215. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
  216. '1 faahi tapu and 6 aho from now',
  217. // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
  218. '2 faahi tapu 1 e tulā',
  219. // Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
  220. '1 e tulā from now',
  221. // CarbonInterval::days(2)->forHumans()
  222. '2 aho',
  223. // CarbonInterval::create('P1DT3H')->forHumans(true)
  224. '1 aho 3 e tulā',
  225. ];
  226. }