FrCmTest.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 FrCmTest extends LocalizationTestCase
  16. {
  17. public const LOCALE = 'fr_CM'; // French
  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. 'Demain à 00:00',
  21. // Carbon::parse('2018-01-04 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  22. 'samedi à 00:00',
  23. // Carbon::parse('2018-01-04 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  24. 'dimanche à 00:00',
  25. // Carbon::parse('2018-01-04 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  26. 'lundi à 00:00',
  27. // Carbon::parse('2018-01-04 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  28. 'mardi à 00:00',
  29. // Carbon::parse('2018-01-04 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  30. 'mercredi à 00:00',
  31. // Carbon::parse('2018-01-05 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-05 00:00:00'))
  32. 'jeudi à 00:00',
  33. // Carbon::parse('2018-01-06 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-06 00:00:00'))
  34. 'vendredi à 00:00',
  35. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  36. 'mardi à 00:00',
  37. // Carbon::parse('2018-01-07 00:00:00')->addDays(3)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  38. 'mercredi à 00:00',
  39. // Carbon::parse('2018-01-07 00:00:00')->addDays(4)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  40. 'jeudi à 00:00',
  41. // Carbon::parse('2018-01-07 00:00:00')->addDays(5)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  42. 'vendredi à 00:00',
  43. // Carbon::parse('2018-01-07 00:00:00')->addDays(6)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  44. 'samedi à 00:00',
  45. // Carbon::now()->subDays(2)->calendar()
  46. 'dimanche dernier à 20:49',
  47. // Carbon::parse('2018-01-04 00:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  48. 'Hier à 22:00',
  49. // Carbon::parse('2018-01-04 12:00:00')->subHours(2)->calendar(Carbon::parse('2018-01-04 12:00:00'))
  50. 'Aujourd’hui à 10:00',
  51. // Carbon::parse('2018-01-04 00:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  52. 'Aujourd’hui à 02:00',
  53. // Carbon::parse('2018-01-04 23:00:00')->addHours(2)->calendar(Carbon::parse('2018-01-04 23:00:00'))
  54. 'Demain à 01:00',
  55. // Carbon::parse('2018-01-07 00:00:00')->addDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  56. 'mardi à 00:00',
  57. // Carbon::parse('2018-01-08 00:00:00')->subDay()->calendar(Carbon::parse('2018-01-08 00:00:00'))
  58. 'Hier à 00:00',
  59. // Carbon::parse('2018-01-04 00:00:00')->subDays(1)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  60. 'Hier à 00:00',
  61. // Carbon::parse('2018-01-04 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  62. 'mardi dernier à 00:00',
  63. // Carbon::parse('2018-01-04 00:00:00')->subDays(3)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  64. 'lundi dernier à 00:00',
  65. // Carbon::parse('2018-01-04 00:00:00')->subDays(4)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  66. 'dimanche dernier à 00:00',
  67. // Carbon::parse('2018-01-04 00:00:00')->subDays(5)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  68. 'samedi dernier à 00:00',
  69. // Carbon::parse('2018-01-04 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-04 00:00:00'))
  70. 'vendredi dernier à 00:00',
  71. // Carbon::parse('2018-01-03 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-03 00:00:00'))
  72. 'jeudi dernier à 00:00',
  73. // Carbon::parse('2018-01-02 00:00:00')->subDays(6)->calendar(Carbon::parse('2018-01-02 00:00:00'))
  74. 'mercredi dernier à 00:00',
  75. // Carbon::parse('2018-01-07 00:00:00')->subDays(2)->calendar(Carbon::parse('2018-01-07 00:00:00'))
  76. 'vendredi dernier à 00:00',
  77. // Carbon::parse('2018-01-01 00:00:00')->isoFormat('Qo Mo Do Wo wo')
  78. '1er 1er 1er 1re 1re',
  79. // Carbon::parse('2018-01-02 00:00:00')->isoFormat('Do wo')
  80. '2 1re',
  81. // Carbon::parse('2018-01-03 00:00:00')->isoFormat('Do wo')
  82. '3 1re',
  83. // Carbon::parse('2018-01-04 00:00:00')->isoFormat('Do wo')
  84. '4 1re',
  85. // Carbon::parse('2018-01-05 00:00:00')->isoFormat('Do wo')
  86. '5 1re',
  87. // Carbon::parse('2018-01-06 00:00:00')->isoFormat('Do wo')
  88. '6 1re',
  89. // Carbon::parse('2018-01-07 00:00:00')->isoFormat('Do wo')
  90. '7 1re',
  91. // Carbon::parse('2018-01-11 00:00:00')->isoFormat('Do wo')
  92. '11 2e',
  93. // Carbon::parse('2018-02-09 00:00:00')->isoFormat('DDDo')
  94. '40e',
  95. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('DDDo')
  96. '41e',
  97. // Carbon::parse('2018-04-10 00:00:00')->isoFormat('DDDo')
  98. '100e',
  99. // Carbon::parse('2018-02-10 00:00:00', 'Europe/Paris')->isoFormat('h:mm a z')
  100. '12:00 mat. CET',
  101. // Carbon::parse('2018-02-10 00:00:00')->isoFormat('h:mm A, h:mm a')
  102. '12:00 mat., 12:00 mat.',
  103. // Carbon::parse('2018-02-10 01:30:00')->isoFormat('h:mm A, h:mm a')
  104. '1:30 mat., 1:30 mat.',
  105. // Carbon::parse('2018-02-10 02:00:00')->isoFormat('h:mm A, h:mm a')
  106. '2:00 mat., 2:00 mat.',
  107. // Carbon::parse('2018-02-10 06:00:00')->isoFormat('h:mm A, h:mm a')
  108. '6:00 mat., 6:00 mat.',
  109. // Carbon::parse('2018-02-10 10:00:00')->isoFormat('h:mm A, h:mm a')
  110. '10:00 mat., 10:00 mat.',
  111. // Carbon::parse('2018-02-10 12:00:00')->isoFormat('h:mm A, h:mm a')
  112. '12:00 soir, 12:00 soir',
  113. // Carbon::parse('2018-02-10 17:00:00')->isoFormat('h:mm A, h:mm a')
  114. '5:00 soir, 5:00 soir',
  115. // Carbon::parse('2018-02-10 21:30:00')->isoFormat('h:mm A, h:mm a')
  116. '9:30 soir, 9:30 soir',
  117. // Carbon::parse('2018-02-10 23:00:00')->isoFormat('h:mm A, h:mm a')
  118. '11:00 soir, 11:00 soir',
  119. // Carbon::parse('2018-01-01 00:00:00')->ordinal('hour')
  120. '0e',
  121. // Carbon::now()->subSeconds(1)->diffForHumans()
  122. 'il y a 1 seconde',
  123. // Carbon::now()->subSeconds(1)->diffForHumans(null, false, true)
  124. 'il y a 1 s',
  125. // Carbon::now()->subSeconds(2)->diffForHumans()
  126. 'il y a 2 secondes',
  127. // Carbon::now()->subSeconds(2)->diffForHumans(null, false, true)
  128. 'il y a 2 s',
  129. // Carbon::now()->subMinutes(1)->diffForHumans()
  130. 'il y a 1 minute',
  131. // Carbon::now()->subMinutes(1)->diffForHumans(null, false, true)
  132. 'il y a 1 min',
  133. // Carbon::now()->subMinutes(2)->diffForHumans()
  134. 'il y a 2 minutes',
  135. // Carbon::now()->subMinutes(2)->diffForHumans(null, false, true)
  136. 'il y a 2 min',
  137. // Carbon::now()->subHours(1)->diffForHumans()
  138. 'il y a 1 heure',
  139. // Carbon::now()->subHours(1)->diffForHumans(null, false, true)
  140. 'il y a 1 h',
  141. // Carbon::now()->subHours(2)->diffForHumans()
  142. 'il y a 2 heures',
  143. // Carbon::now()->subHours(2)->diffForHumans(null, false, true)
  144. 'il y a 2 h',
  145. // Carbon::now()->subDays(1)->diffForHumans()
  146. 'il y a 1 jour',
  147. // Carbon::now()->subDays(1)->diffForHumans(null, false, true)
  148. 'il y a 1 j',
  149. // Carbon::now()->subDays(2)->diffForHumans()
  150. 'il y a 2 jours',
  151. // Carbon::now()->subDays(2)->diffForHumans(null, false, true)
  152. 'il y a 2 j',
  153. // Carbon::now()->subWeeks(1)->diffForHumans()
  154. 'il y a 1 semaine',
  155. // Carbon::now()->subWeeks(1)->diffForHumans(null, false, true)
  156. 'il y a 1 sem.',
  157. // Carbon::now()->subWeeks(2)->diffForHumans()
  158. 'il y a 2 semaines',
  159. // Carbon::now()->subWeeks(2)->diffForHumans(null, false, true)
  160. 'il y a 2 sem.',
  161. // Carbon::now()->subMonths(1)->diffForHumans()
  162. 'il y a 1 mois',
  163. // Carbon::now()->subMonths(1)->diffForHumans(null, false, true)
  164. 'il y a 1 mois',
  165. // Carbon::now()->subMonths(2)->diffForHumans()
  166. 'il y a 2 mois',
  167. // Carbon::now()->subMonths(2)->diffForHumans(null, false, true)
  168. 'il y a 2 mois',
  169. // Carbon::now()->subYears(1)->diffForHumans()
  170. 'il y a 1 an',
  171. // Carbon::now()->subYears(1)->diffForHumans(null, false, true)
  172. 'il y a 1 an',
  173. // Carbon::now()->subYears(2)->diffForHumans()
  174. 'il y a 2 ans',
  175. // Carbon::now()->subYears(2)->diffForHumans(null, false, true)
  176. 'il y a 2 ans',
  177. // Carbon::now()->addSecond()->diffForHumans()
  178. 'dans 1 seconde',
  179. // Carbon::now()->addSecond()->diffForHumans(null, false, true)
  180. 'dans 1 s',
  181. // Carbon::now()->addSecond()->diffForHumans(Carbon::now())
  182. '1 seconde après',
  183. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), false, true)
  184. '1 s après',
  185. // Carbon::now()->diffForHumans(Carbon::now()->addSecond())
  186. '1 seconde avant',
  187. // Carbon::now()->diffForHumans(Carbon::now()->addSecond(), false, true)
  188. '1 s avant',
  189. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true)
  190. '1 seconde',
  191. // Carbon::now()->addSecond()->diffForHumans(Carbon::now(), true, true)
  192. '1 s',
  193. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true)
  194. '2 secondes',
  195. // Carbon::now()->diffForHumans(Carbon::now()->addSecond()->addSecond(), true, true)
  196. '2 s',
  197. // Carbon::now()->addSecond()->diffForHumans(null, false, true, 1)
  198. 'dans 1 s',
  199. // Carbon::now()->addMinute()->addSecond()->diffForHumans(null, true, false, 2)
  200. '1 minute 1 seconde',
  201. // Carbon::now()->addYears(2)->addMonths(3)->addDay()->addSecond()->diffForHumans(null, true, true, 4)
  202. '2 ans 3 mois 1 j 1 s',
  203. // Carbon::now()->addYears(3)->diffForHumans(null, null, false, 4)
  204. 'dans 3 ans',
  205. // Carbon::now()->subMonths(5)->diffForHumans(null, null, true, 4)
  206. 'il y a 5 mois',
  207. // Carbon::now()->subYears(2)->subMonths(3)->subDay()->subSecond()->diffForHumans(null, null, true, 4)
  208. 'il y a 2 ans 3 mois 1 j 1 s',
  209. // Carbon::now()->addWeek()->addHours(10)->diffForHumans(null, true, false, 2)
  210. '1 semaine 10 heures',
  211. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  212. '1 semaine 6 jours',
  213. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(null, true, false, 2)
  214. '1 semaine 6 jours',
  215. // Carbon::now()->addWeek()->addDays(6)->diffForHumans(["join" => true, "parts" => 2])
  216. 'dans 1 semaine et 6 jours',
  217. // Carbon::now()->addWeeks(2)->addHour()->diffForHumans(null, true, false, 2)
  218. '2 semaines 1 heure',
  219. // Carbon::now()->addHour()->diffForHumans(["aUnit" => true])
  220. 'dans une heure',
  221. // CarbonInterval::days(2)->forHumans()
  222. '2 jours',
  223. // CarbonInterval::create('P1DT3H')->forHumans(true)
  224. '1 j 3 h',
  225. ];
  226. }