1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ob\HighchartsBundle\Tests\Highcharts; |
4
|
|
|
|
5
|
|
|
use Ob\HighchartsBundle\Highcharts\Highchart; |
6
|
|
|
use PHPUnit\Framework\TestCase; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* This class hold Unit tests for the lang option |
10
|
|
|
*/ |
11
|
|
|
class LangTest extends TestCase |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* Set localized month names |
15
|
|
|
*/ |
16
|
|
|
public function testMonths() |
17
|
|
|
{ |
18
|
|
|
$chart = new Highchart(); |
19
|
|
|
$chart->lang->months(array('Janvier', 'Fevrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'Decembre')); |
20
|
|
|
|
21
|
|
|
$this->assertRegExp( |
22
|
|
|
'/lang: \{"months":\["Janvier","Fevrier","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Decembre"\]\}/', |
23
|
|
|
$chart->render() |
24
|
|
|
); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Set abbreviated localized month names |
29
|
|
|
*/ |
30
|
|
|
public function testShortMonths() |
31
|
|
|
{ |
32
|
|
|
$chart = new Highchart(); |
33
|
|
|
$chart->lang->shortMonths(array('Jan', 'Fev', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil', 'Aout', 'Sept', 'Oct', 'Nov', 'Dec')); |
34
|
|
|
|
35
|
|
|
$this->assertRegExp( |
36
|
|
|
'/lang: \{"shortMonths":\["Jan","Fev","Mars","Avril","Mai","Juin","Juil","Aout","Sept","Oct","Nov","Dec"\]\}/', |
37
|
|
|
$chart->render() |
38
|
|
|
); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Set localized weekday names |
43
|
|
|
*/ |
44
|
|
|
public function testWeekDays() |
45
|
|
|
{ |
46
|
|
|
$chart = new Highchart(); |
47
|
|
|
$chart->lang->weekdays(array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi')); |
48
|
|
|
|
49
|
|
|
$this->assertRegExp( |
50
|
|
|
'/lang: \{"weekdays":\["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"\]\}/', |
51
|
|
|
$chart->render() |
52
|
|
|
); |
53
|
|
|
} |
54
|
|
|
} |
55
|
|
|
|