22
33namespace Tests ;
44
5+ use Bbsnly \ChartJs \BarChart ;
6+ use Bbsnly \ChartJs \BubbleChart ;
57use Bbsnly \ChartJs \Chart ;
68use Bbsnly \ChartJs \Config \Data ;
79use Bbsnly \ChartJs \Config \Dataset ;
810use Bbsnly \ChartJs \Config \Options ;
11+ use Bbsnly \ChartJs \DoughnutChart ;
12+ use Bbsnly \ChartJs \LineChart ;
13+ use Bbsnly \ChartJs \PieChart ;
14+ use Bbsnly \ChartJs \PolarAreaChart ;
15+ use Bbsnly \ChartJs \RadarChart ;
16+ use Bbsnly \ChartJs \ScatterChart ;
917
1018class ChartTest extends TestCase
1119{
@@ -26,6 +34,78 @@ public function test_can_create_it()
2634 $ this ->assertInstanceOf (Chart::class, $ this ->chart );
2735 }
2836
37+ /**
38+ * Test if chart type is correctly set using helper class BarChart.
39+ */
40+ public function test_can_create_bar_chart ()
41+ {
42+ $ this ->chart = new BarChart ;
43+ $ this ->assertEquals ('bar ' , $ this ->chart ->type );
44+ }
45+
46+ /**
47+ * Test if chart type is correctly set using helper class BubbleChart.
48+ */
49+ public function test_can_create_bubble_chart ()
50+ {
51+ $ this ->chart = new BubbleChart ;
52+ $ this ->assertEquals ('bubble ' , $ this ->chart ->type );
53+ }
54+
55+ /**
56+ * Test if chart type is correctly set using helper class DoughnutChart.
57+ */
58+ public function test_can_create_doughnut_chart ()
59+ {
60+ $ this ->chart = new DoughnutChart ;
61+ $ this ->assertEquals ('doughnut ' , $ this ->chart ->type );
62+ }
63+
64+ /**
65+ * Test if chart type is correctly set using helper class LineChart.
66+ */
67+ public function test_can_create_line_chart ()
68+ {
69+ $ this ->chart = new LineChart ;
70+ $ this ->assertEquals ('line ' , $ this ->chart ->type );
71+ }
72+
73+ /**
74+ * Test if chart type is correctly set using helper class PieChart.
75+ */
76+ public function test_can_create_pie_chart ()
77+ {
78+ $ this ->chart = new PieChart ;
79+ $ this ->assertEquals ('pie ' , $ this ->chart ->type );
80+ }
81+
82+ /**
83+ * Test if chart type is correctly set using helper class PolarAreaChart.
84+ */
85+ public function test_can_create_polar_area_chart ()
86+ {
87+ $ this ->chart = new PolarAreaChart ;
88+ $ this ->assertEquals ('polarArea ' , $ this ->chart ->type );
89+ }
90+
91+ /**
92+ * Test if chart type is correctly set using helper class RadarChart.
93+ */
94+ public function test_can_create_radar_chart ()
95+ {
96+ $ this ->chart = new RadarChart ;
97+ $ this ->assertEquals ('radar ' , $ this ->chart ->type );
98+ }
99+
100+ /**
101+ * Test if chart type is correctly set using helper class ScatterChart.
102+ */
103+ public function test_can_create_scatter_chart ()
104+ {
105+ $ this ->chart = new ScatterChart ;
106+ $ this ->assertEquals ('scatter ' , $ this ->chart ->type );
107+ }
108+
29109 /**
30110 * Test if the chart is responsive.
31111 *
0 commit comments