Hoa central
Http.php
Go to the documentation of this file.
1 <?php
2 
38 
39 use Hoa\Locale\Localizer\Http as CUT;
40 use Hoa\Test;
41 
50 class Http extends Test\Unit\Suite
51 {
52  public function case_classic()
53  {
54  $this
55  ->given($localizer = new CUT('fr-fr,en-uk;q=0.7,en;q=0.3'))
56  ->when($result = $localizer->getLocale())
57  ->then
58  ->string($result)
59  ->isEqualTo('fr-fr');
60  }
61 
62  public function case_cfws()
63  {
64  $this
65  ->given($localizer = new CUT('fr-fr , en-uk ; q = 0.7'))
66  ->when($result = $localizer->getLocale())
67  ->then
68  ->string($result)
69  ->isEqualTo('fr-fr');
70  }
71 
72  public function case_q_on_first()
73  {
74  $this
75  ->given($localizer = new CUT('fr-fr;q=0.9,en-uk;q=0.7'))
76  ->when($result = $localizer->getLocale())
77  ->then
78  ->string($result)
79  ->isEqualTo('fr-fr');
80  }
81 }