Skip to content

Commit d1d28c0

Browse files
committed
Update to v11 of PhpUnit
1 parent 5456e23 commit d1d28c0

File tree

2 files changed

+15
-36
lines changed

2 files changed

+15
-36
lines changed

phpunit.xml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false">
11-
<testsuites>
12-
<testsuite name="Unit">
13-
<directory suffix="Test.php">./tests</directory>
14-
</testsuite>
15-
</testsuites>
6+
> <testsuites>
7+
<testsuite name="Unit">
8+
<directory suffix="Test.php">./tests</directory>
9+
</testsuite>
10+
</testsuites>
1611
</phpunit>

tests/ChartTest.php

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,22 @@ protected function setUp(): void
1717
}
1818

1919
/**
20-
* @test
21-
*
2220
* Test if the chart instance can be created successfully.
2321
*
2422
* We assert that the created instance is an instance of the Chart class.
2523
*/
26-
public function can_create_it()
24+
public function test_can_create_it()
2725
{
2826
$this->assertInstanceOf(Chart::class, $this->chart);
2927
}
3028

3129
/**
32-
* @test
33-
*
3430
* Test if the chart is responsive.
3531
*
3632
* We set the chart type to 'line' and assert that the chart options
3733
* include the 'responsive' property set to true.
3834
*/
39-
public function it_is_responsive()
35+
public function test_it_is_responsive()
4036
{
4137
$expected = [
4238
'type' => 'line',
@@ -55,15 +51,13 @@ public function it_is_responsive()
5551
}
5652

5753
/**
58-
* @test
59-
*
6054
* Test if the chart is animated.
6155
*
6256
* We set the chart type to 'line' and assert that the chart
6357
* options include the 'responsive' property set to true and the
6458
* 'responsiveAnimationDuration' property set to 10.
6559
*/
66-
public function it_is_animated()
60+
public function test_it_is_animated()
6761
{
6862
$expected = [
6963
'type' => 'line',
@@ -86,15 +80,13 @@ public function it_is_animated()
8680
}
8781

8882
/**
89-
* @test
90-
*
9183
* Test if the chart has basic datasets in JSON format.
9284
*
9385
* We create a Data object with two datasets, each containing an array of data values.
9486
* We set the chart data to the created Data object and assert that the
9587
* chart data is encoded to the expected JSON format.
9688
*/
97-
public function it_has_basic_datasets_json()
89+
public function test_it_has_basic_datasets_json()
9890
{
9991
$data = new Data([
10092
'datasets' => [
@@ -128,8 +120,6 @@ public function it_has_basic_datasets_json()
128120
}
129121

130122
/**
131-
* @test
132-
*
133123
* Test if the chart has basic data with labels.
134124
*
135125
* We create a Data object and two Dataset objects.
@@ -138,7 +128,7 @@ public function it_has_basic_datasets_json()
138128
* We assert that the chart data includes the datasets, labels, and
139129
* other properties in the expected format.
140130
*/
141-
public function it_has_basic_data_with_labels()
131+
public function test_it_has_basic_data_with_labels()
142132
{
143133
$data = new Data;
144134

@@ -171,8 +161,6 @@ public function it_has_basic_data_with_labels()
171161
}
172162

173163
/**
174-
* @test
175-
*
176164
* Test if the chart has basic data with labels and colors.
177165
*
178166
* We create a Data object and two Dataset objects.
@@ -181,7 +169,7 @@ public function it_has_basic_data_with_labels()
181169
* We assert that the chart data includes the datasets, labels,
182170
* background colors, and other properties in the expected format.
183171
*/
184-
public function it_has_basic_data_with_labels_and_colors()
172+
public function test_it_has_basic_data_with_labels_and_colors()
185173
{
186174
$data = new Data;
187175

@@ -216,8 +204,6 @@ public function it_has_basic_data_with_labels_and_colors()
216204
}
217205

218206
/**
219-
* @test
220-
*
221207
* Test if the chart can be configured to start from zero using a helper method.
222208
*
223209
* We create a Data object and a Dataset object.
@@ -229,7 +215,7 @@ public function it_has_basic_data_with_labels_and_colors()
229215
* background colors, and other properties in the expected format,
230216
* including the 'beginAtZero' configuration for the y-axis ticks.
231217
*/
232-
public function can_set_start_from_zero_using_helper()
218+
public function test_can_set_start_from_zero_using_helper()
233219
{
234220
$data = new Data;
235221

@@ -271,8 +257,6 @@ public function can_set_start_from_zero_using_helper()
271257
}
272258

273259
/**
274-
* @test
275-
*
276260
* Test if the chart can create mixed chart types.
277261
*
278262
* We set the chart type to 'bar' and create a Data object.
@@ -282,7 +266,7 @@ public function can_set_start_from_zero_using_helper()
282266
* We assert that the chart data includes the datasets, labels, chart type,
283267
* and other properties in the expected format.
284268
*/
285-
public function can_create_mixed_chart_types()
269+
public function test_can_create_mixed_chart_types()
286270
{
287271
$this->chart->type = 'bar';
288272

0 commit comments

Comments
 (0)