Skip to content

Commit 6fba5ed

Browse files
committed
PHPUnit 10 port
1 parent 99611c6 commit 6fba5ed

File tree

7 files changed

+59
-59
lines changed

7 files changed

+59
-59
lines changed

Tests/CustomFieldTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,44 @@ class CustomFieldTest extends \PHPUnit\Framework\TestCase
1313
{
1414
public function testBadArrayType() : void
1515
{
16-
$fixture = new \Tests\Fixtures\CustomFieldTest();
16+
$fixture = new \Tests\Fixtures\CustomField();
1717
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
1818
$fixture->cf_array = [];
1919
}
2020

2121
public function testBadBooleanType() : void
2222
{
23-
$fixture = new \Tests\Fixtures\CustomFieldTest();
23+
$fixture = new \Tests\Fixtures\CustomField();
2424
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
2525
$fixture->cf_boolean = true;
2626
}
2727

2828
public function testBadFloatType() : void
2929
{
30-
$fixture = new \Tests\Fixtures\CustomFieldTest();
30+
$fixture = new \Tests\Fixtures\CustomField();
3131
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
3232
$fixture->cf_float = 1.234;
3333
}
3434

3535
public function testBadIntType() : void
3636
{
37-
$fixture = new \Tests\Fixtures\CustomFieldTest();
37+
$fixture = new \Tests\Fixtures\CustomField();
3838
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
3939
$fixture->cf_integer = 0;
4040
}
4141

4242
public function testGetSet() : void
4343
{
4444
$string = 'A long string';
45-
$fixture = new \Tests\Fixtures\CustomFieldTest();
45+
$fixture = new \Tests\Fixtures\CustomField();
4646
$fixture->cf_string = $string;
4747
$this->assertEquals($string, $fixture->cf_string);
4848
$this->assertIsString($fixture->cf_string);
4949
}
5050

5151
public function testJsonOutput() : void
5252
{
53-
$class = new \Tests\Fixtures\CustomFieldTest();
53+
$class = new \Tests\Fixtures\CustomField();
5454
$class->cf_gender = 'mail';
5555
$class->cf_firstName = 'First';
5656
$class->cf_lastName = 'Class';
@@ -65,14 +65,14 @@ public function testJsonOutput() : void
6565
$expectedJSON = \str_replace("\r\n", "\n", $expectedJSON);
6666
$this->assertEquals($expectedJSON, $json);
6767

68-
$class = new \Tests\Fixtures\CustomFieldTest(['cf_gender' => 'mail', 'cf_firstName' => 'First', 'cf_lastName' => 'Class']);
68+
$class = new \Tests\Fixtures\CustomField(['cf_gender' => 'mail', 'cf_firstName' => 'First', 'cf_lastName' => 'Class']);
6969
$json = $class->getJSON();
7070
$this->assertEquals($expectedJSON, $json);
7171
}
7272

7373
public function testMaxLength() : void
7474
{
75-
$fixture = new \Tests\Fixtures\CustomFieldTest();
75+
$fixture = new \Tests\Fixtures\CustomField();
7676
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
7777
$fixture->cf_string = \str_pad('', 300);
7878
}

Tests/DefinitionTest.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,127 +13,127 @@ class DefinitionTest extends \PHPUnit\Framework\TestCase
1313
{
1414
public function testBadArrayOfTypeSizeMax() : void
1515
{
16-
$fixture = new \Tests\Fixtures\TypeTest();
16+
$fixture = new \Tests\Fixtures\Type();
1717
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
1818
$fixture->classArraySize = [
19-
new \Tests\Fixtures\ClassTest(),
20-
new \Tests\Fixtures\ClassTest(),
21-
new \Tests\Fixtures\ClassTest(),
22-
new \Tests\Fixtures\ClassTest(),
23-
new \Tests\Fixtures\ClassTest(),
19+
new \Tests\Fixtures\ClassTester(),
20+
new \Tests\Fixtures\ClassTester(),
21+
new \Tests\Fixtures\ClassTester(),
22+
new \Tests\Fixtures\ClassTester(),
23+
new \Tests\Fixtures\ClassTester(),
2424
];
2525
}
2626

2727
public function testBadArrayOfTypeSizeMin() : void
2828
{
29-
$fixture = new \Tests\Fixtures\TypeTest();
29+
$fixture = new \Tests\Fixtures\Type();
3030
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
3131
$fixture->classArraySizeMin = [
32-
new \Tests\Fixtures\ClassTest(),
32+
new \Tests\Fixtures\ClassTester(),
3333
];
3434
}
3535

3636
public function testBadArrayType() : void
3737
{
38-
$fixture = new \Tests\Fixtures\TypeTest();
38+
$fixture = new \Tests\Fixtures\Type();
3939
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
4040
$fixture->array = 0;
4141
}
4242

4343
public function testBadArrayTypes() : void
4444
{
45-
$fixture = new \Tests\Fixtures\TypeTest();
45+
$fixture = new \Tests\Fixtures\Type();
4646
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
4747
$fixture->classArray = [
48-
new \Tests\Fixtures\ClassTest(),
49-
new \Tests\Fixtures\ClassTest(),
50-
new \Tests\Fixtures\TypeTest(),
48+
new \Tests\Fixtures\ClassTester(),
49+
new \Tests\Fixtures\ClassTester(),
50+
new \Tests\Fixtures\Type(),
5151
];
5252
}
5353

5454
public function testBadBooleanType() : void
5555
{
56-
$fixture = new \Tests\Fixtures\TypeTest();
56+
$fixture = new \Tests\Fixtures\Type();
5757
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
5858
$fixture->boolean = 0;
5959
}
6060

6161
public function testBadClassType() : void
6262
{
63-
$fixture = new \Tests\Fixtures\TypeTest();
63+
$fixture = new \Tests\Fixtures\Type();
6464
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
6565
$fixture->class = new \DateTime();
6666
}
6767

6868
public function testBadEnum() : void
6969
{
70-
$fixture = new \Tests\Fixtures\TypeTest();
70+
$fixture = new \Tests\Fixtures\Type();
7171
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidValue::class);
7272
$fixture->enum = 'fred';
7373
}
7474

7575
public function testBadField() : void
7676
{
77-
$fixture = new \Tests\Fixtures\TypeTest();
77+
$fixture = new \Tests\Fixtures\Type();
7878
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidField::class);
7979
$fixture->badField = 'test';
8080
}
8181

8282
public function testBadFloatType() : void
8383
{
84-
$fixture = new \Tests\Fixtures\TypeTest();
84+
$fixture = new \Tests\Fixtures\Type();
8585
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
8686
$fixture->float = 'abc';
8787
}
8888

8989
public function testBadIntType() : void
9090
{
91-
$fixture = new \Tests\Fixtures\TypeTest();
91+
$fixture = new \Tests\Fixtures\Type();
9292
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
9393
$fixture->integer = 'test';
9494
}
9595

9696
public function testBadStringType() : void
9797
{
98-
$fixture = new \Tests\Fixtures\TypeTest();
98+
$fixture = new \Tests\Fixtures\Type();
9999
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
100100
$fixture->string = 123;
101101
}
102102

103103
public function testClassArray() : void
104104
{
105-
$testClass = new \Tests\Fixtures\ClassTest();
105+
$testClass = new \Tests\Fixtures\ClassTester();
106106
$original = [
107-
'classArray' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
107+
'classArray' => [$testClass, new \Tests\Fixtures\ClassTester(), ],
108108
];
109109

110-
$fixture = new \Tests\Fixtures\TypeTest($original);
110+
$fixture = new \Tests\Fixtures\Type($original);
111111

112112
$this->assertIsArray($fixture->classArray);
113113
$this->assertCount(2, $fixture->classArray);
114114
}
115115

116116
public function testClassArraySize() : void
117117
{
118-
$testClass = new \Tests\Fixtures\ClassTest();
118+
$testClass = new \Tests\Fixtures\ClassTester();
119119
$original = [
120-
'classArraySize' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
120+
'classArraySize' => [$testClass, new \Tests\Fixtures\ClassTester(), ],
121121
];
122122

123-
$fixture = new \Tests\Fixtures\TypeTest($original);
123+
$fixture = new \Tests\Fixtures\Type($original);
124124

125125
$this->assertIsArray($fixture->classArraySize);
126126
$this->assertCount(2, $fixture->classArraySize);
127127
}
128128

129129
public function testClassArraySizeMin() : void
130130
{
131-
$testClass = new \Tests\Fixtures\ClassTest();
131+
$testClass = new \Tests\Fixtures\ClassTester();
132132
$original = [
133-
'classArraySizeMin' => [$testClass, new \Tests\Fixtures\ClassTest(), ],
133+
'classArraySizeMin' => [$testClass, new \Tests\Fixtures\ClassTester(), ],
134134
];
135135

136-
$fixture = new \Tests\Fixtures\TypeTest($original);
136+
$fixture = new \Tests\Fixtures\Type($original);
137137

138138
$this->assertIsArray($fixture->classArraySizeMin);
139139
$this->assertCount(2, $fixture->classArraySizeMin);
@@ -152,17 +152,17 @@ public function testConstructFromArray() : void
152152
'intEnum' => 5,
153153
];
154154

155-
$fixture = new \Tests\Fixtures\TypeTest($original);
155+
$fixture = new \Tests\Fixtures\Type($original);
156156
$this->assertEquals($original, $fixture->getData());
157157
}
158158

159159
public function testConstructFromObject() : void
160160
{
161-
$testClass = new \Tests\Fixtures\ClassTest();
161+
$testClass = new \Tests\Fixtures\ClassTester();
162162
$original = [
163163
'class' => $testClass,
164164
];
165-
$fixture = new \Tests\Fixtures\TypeTest($original);
165+
$fixture = new \Tests\Fixtures\Type($original);
166166

167167
$this->assertEquals($testClass, $fixture->class);
168168
}
@@ -176,7 +176,7 @@ public function testGeneratedClass() : void
176176

177177
public function testGetSet() : void
178178
{
179-
$fixture = new \Tests\Fixtures\TypeTest();
179+
$fixture = new \Tests\Fixtures\Type();
180180
$integer = 123;
181181
$fixture->integer = $integer;
182182
$this->assertEquals($integer, $fixture->integer);
@@ -217,7 +217,7 @@ public function testGetSet() : void
217217
$this->assertEquals($string, $fixture->ucEnum);
218218
$this->assertIsString($fixture->ucEnum);
219219

220-
$class = new \Tests\Fixtures\ClassTest();
220+
$class = new \Tests\Fixtures\ClassTester();
221221
$fixture->class = $class;
222222
$this->assertEquals($class, $fixture->class);
223223
$this->assertIsObject($fixture->class);
@@ -245,14 +245,14 @@ public function testGetSet() : void
245245

246246
public function testMaxLength() : void
247247
{
248-
$fixture = new \Tests\Fixtures\TypeTest();
248+
$fixture = new \Tests\Fixtures\Type();
249249
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
250250
$fixture->string = \str_pad('', 100);
251251
}
252252

253253
public function testMinLength() : void
254254
{
255-
$fixture = new \Tests\Fixtures\TypeTest();
255+
$fixture = new \Tests\Fixtures\Type();
256256
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
257257
$fixture->string = 'fred';
258258
}

Tests/Fixtures/ClassTest.php

Lines changed: 0 additions & 8 deletions
This file was deleted.

Tests/Fixtures/ClassTester.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Tests\Fixtures;
4+
5+
class ClassTester extends \PHPFUI\ConstantContact\Definition\Base
6+
{
7+
8+
}

Tests/Fixtures/CustomFieldTest.php renamed to Tests/Fixtures/CustomField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Tests\Fixtures;
44

5-
class CustomFieldTest extends \PHPFUI\ConstantContact\Definition\Base
5+
class CustomField extends \PHPFUI\ConstantContact\Definition\Base
66
{
77
protected static array $fields = [
88
'cf:custom_field_name' => 'string',

Tests/Fixtures/TypeTest.php renamed to Tests/Fixtures/Type.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Tests\Fixtures;
44

5-
class TypeTest extends \PHPFUI\ConstantContact\Definition\Base
5+
class Type extends \PHPFUI\ConstantContact\Definition\Base
66
{
77
protected static array $fields = [
88
'boolean' => 'bool',
@@ -13,10 +13,10 @@ class TypeTest extends \PHPFUI\ConstantContact\Definition\Base
1313
'float' => 'float',
1414
'ucEnum' => ['DRAFT', 'SCHEDULED', 'EXECUTING', 'DONE', 'ERROR', 'REMOVED'],
1515
'intEnum' => [1, 2, 3, 4, 5],
16-
'class' => 'Tests\\Fixtures\\ClassTest',
17-
'classArray' => 'array<\\Tests\\Fixtures\\ClassTest>',
18-
'classArraySize' => 'array<\\Tests\\Fixtures\\ClassTest>',
19-
'classArraySizeMin' => 'array<\\Tests\\Fixtures\\ClassTest>',
16+
'class' => 'Tests\\Fixtures\\ClassTester',
17+
'classArray' => 'array<\\Tests\\Fixtures\\ClassTester>',
18+
'classArraySize' => 'array<\\Tests\\Fixtures\\ClassTester>',
19+
'classArraySizeMin' => 'array<\\Tests\\Fixtures\\ClassTester>',
2020
];
2121

2222
protected static array $maxLength = [

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"spatie/guzzle-rate-limiter-middleware": "^2.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "<10.0",
20+
"phpunit/phpunit": "<11.0",
2121
"gitonomy/gitlib": ">=1.2",
2222
"phpfui/phpunit-syntax-coverage": "^1.0",
2323
"roave/security-advisories": "dev-latest",

0 commit comments

Comments
 (0)