GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( bb8806...1a2c53 )
by Marc
10s
created

ExportingTest::testButtons()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 41
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 41
rs 8.8571
cc 1
eloc 12
nc 1
nop 0
1
<?php
2
3
namespace Ob\HighchartsBundle\Tests\Highcharts;
4
5
use Ob\HighchartsBundle\Highcharts\Highchart;
6
use Zend\Json\Expr;
7
8
/**
9
 * This class hold Unit tests for the exporting option
10
 */
11
class ExportingTest extends \PHPUnit_Framework_TestCase
12
{
13
    /**
14
     * buttons option
15
     */
16
    public function testButtons()
17
    {
18
        $chart = new Highchart();
19
20
        // align option (string - left/center/right)
21
        $chart->exporting->buttons(array('exportButton' => array('align' => 'center')));
22
        $this->assertRegExp('/exporting: \{"buttons":\{"exportButton":\{"align":"center"\}\}\}/', $chart->render());
23
        $chart->exporting->buttons(array('printButton' => array('align' => 'center')));
24
        $this->assertRegExp('/exporting: \{"buttons":\{"printButton":\{"align":"center"\}\}\}/', $chart->render());
25
26
        // backgroundColor option
27
        $chart->exporting->buttons(array('exportButton' => array('backgroundColor' => 'blue')));
28
        $this->assertRegExp('/exporting: \{"buttons":\{"exportButton":\{"backgroundColor":"blue"\}\}\}/', $chart->render());
29
        $chart->exporting->buttons(array('printButton' => array('backgroundColor' => 'blue')));
30
        $this->assertRegExp('/exporting: \{"buttons":\{"printButton":\{"backgroundColor":"blue"\}\}\}/', $chart->render());
31
32
        // borderColor option
33
        // borderRadius option
34
        // borderWidth option
35
        // enabled option
36
        // height option
37
        // hoverBorderColor option
38
        // hoverSymbolFill option
39
        // hoverSymbolStroke option
40
        // menuItems option
41
        // onclick option
42
        // symbol option
43
        // symbolFill option
44
        // symbolSize option
45
        // symbolStroke option (color)
46
        // symbolStrokeWidth option (integer - stroke width in px)
47
        // symbolX option (float)
48
        // symbolY option (float)
49
        // verticalAlign option (string - top/middle/bottom)
50
        // width option (integer - width in px)
51
        // x option (integer - horizontal offset in px)
52
        // y option (integer - vertical offset in px)
53
        $this->markTestIncomplete(
54
            'This test has not been implemented yet.'
55
        );
56
    }
57
58
    /**
59
     * chartOptions option
60
     */
61
    public function testChartOptions()
62
    {
63
        $this->markTestIncomplete(
64
            'This test has not been implemented yet.'
65
        );
66
    }
67
68
    /**
69
     * enabled option (true/false)
70
     */
71
    public function testEnabled()
72
    {
73
        $chart = new Highchart();
74
75
        $chart->exporting->enabled(true);
76
        $this->assertRegExp('/exporting: \{"enabled":true\}/', $chart->render());
77
78
        $chart->exporting->enabled(false);
79
        $this->assertRegExp('/exporting: \{"enabled":false\}/', $chart->render());
80
    }
81
82
    /**
83
     * filename option (string)
84
     */
85
    public function testFilename()
86
    {
87
        $chart = new Highchart();
88
        $chart->exporting->filename("graph");
89
90
        $this->assertRegExp('/exporting: \{"filename":"graph"\}/', $chart->render());
91
    }
92
93
    /**
94
     * type option (string - image/png, image/jpeg, application/pdf or image/svg+xml)
95
     */
96
    public function testType()
97
    {
98
        $chart = new Highchart();
99
100
        // We need to use a Json Expr or else the slashes are escaped
101
        $chart->exporting->type(new Expr('"image/png"'));
102
        $this->assertRegExp('/exporting: \{"type":"image\/png"\}/', $chart->render());
103
104
        $chart->exporting->type(new Expr('"image/jpeg"'));
105
        $this->assertRegExp('/exporting: \{"type":"image\/jpeg"\}/', $chart->render());
106
107
        $chart->exporting->type(new Expr('"application/pdf"'));
108
        $this->assertRegExp('/exporting: \{"type":"application\/pdf"\}/', $chart->render());
109
110
        $chart->exporting->type(new Expr('"image/svg+xml"'));
111
        $this->assertRegExp('/exporting: \{"type":"image\/svg\+xml"\}/', $chart->render());
112
    }
113
114
    /**
115
     * url option (string)
116
     */
117
    public function testUrl()
118
    {
119
        $chart = new Highchart();
120
121
        // We need to use a Json Expr or else the slashes are escaped
122
        $chart->exporting->url(new Expr('"http://www.google.com"'));
123
124
        $this->assertRegExp('/exporting: \{"url":"http:\/\/www.google.com"\}/', $chart->render());
125
    }
126
127
    /**
128
     * width option (integer - width in px)
129
     */
130
    public function testWidth()
131
    {
132
        $chart = new Highchart();
133
        $chart->exporting->width(300);
134
135
        $this->assertRegExp('/exporting: \{"width":300\}/', $chart->render());
136
    }
137
}
138