Skip to content

Commit cb53d9f

Browse files
committed
PHP 8.3
1 parent de65d1e commit cb53d9f

File tree

4 files changed

+40
-39
lines changed

4 files changed

+40
-39
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [8.2, 8.1, 8.0]
11+
php: [8.3, 8.2, 8.1, 8.0]
1212
dependency-version: [prefer-stable]
1313
os: [ubuntu-latest, windows-latest]
1414

Tests/DefinitionTest.php

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,6 @@ public function testBadClassType() : void
6565
$fixture->class = new \DateTime();
6666
}
6767

68-
public function testClassAssignedInt() : void
69-
{
70-
$fixture = new \Tests\Fixtures\Type();
71-
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
72-
$fixture->class = 1;
73-
}
74-
75-
public function testClassAssignedString() : void
76-
{
77-
$fixture = new \Tests\Fixtures\Type();
78-
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
79-
$fixture->class = 'class';
80-
}
81-
8268
public function testBadEnum() : void
8369
{
8470
$fixture = new \Tests\Fixtures\Type();
@@ -153,6 +139,20 @@ public function testClassArraySizeMin() : void
153139
$this->assertCount(2, $fixture->classArraySizeMin);
154140
}
155141

142+
public function testClassAssignedInt() : void
143+
{
144+
$fixture = new \Tests\Fixtures\Type();
145+
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
146+
$fixture->class = 1;
147+
}
148+
149+
public function testClassAssignedString() : void
150+
{
151+
$fixture = new \Tests\Fixtures\Type();
152+
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidType::class);
153+
$fixture->class = 'class';
154+
}
155+
156156
public function testConstructFromArray() : void
157157
{
158158
$original = [
@@ -181,6 +181,29 @@ public function testConstructFromObject() : void
181181
$this->assertEquals($testClass, $fixture->class);
182182
}
183183

184+
public function testDefaultObjects() : void
185+
{
186+
$address = [];
187+
$address['created_at'] = (string)new \PHPFUI\ConstantContact\DateTime();
188+
$address['permission_to_send'] = 'explicit';
189+
190+
$email_address = new \PHPFUI\ConstantContact\Definition\EmailAddressPut($address);
191+
$contact = ['email_address' => $email_address];
192+
193+
$contactBody = new \PHPFUI\ConstantContact\Definition\ContactPutRequest($contact);
194+
$contactBody->update_source = 'Account';
195+
$contactBody->street_addresses = [new \PHPFUI\ConstantContact\Definition\StreetAddressPut([
196+
'kind' => 'home',
197+
'street' => 'address',
198+
'city' => 'town',
199+
'state' => 'state',
200+
'postal_code' => 'zip',
201+
'country' => 'USA', ])];
202+
$json = $contactBody->getJSON();
203+
204+
$this->assertStringContainsString('created_at', $json);
205+
}
206+
184207
public function testGeneratedClass() : void
185208
{
186209
$fixture = new \PHPFUI\ConstantContact\Definition\EmailCampaignActivity();
@@ -270,27 +293,4 @@ public function testMinLength() : void
270293
$this->expectException(\PHPFUI\ConstantContact\Exception\InvalidLength::class);
271294
$fixture->string = 'fred';
272295
}
273-
274-
public function testDefaultObjects() : void
275-
{
276-
$address = [];
277-
$address['created_at'] = (string)new \PHPFUI\ConstantContact\DateTime();
278-
$address['permission_to_send'] = 'explicit';
279-
280-
$email_address = new \PHPFUI\ConstantContact\Definition\EmailAddressPut($address);
281-
$contact = ['email_address' => $email_address];
282-
283-
$contactBody = new \PHPFUI\ConstantContact\Definition\ContactPutRequest($contact);
284-
$contactBody->update_source = 'Account';
285-
$contactBody->street_addresses = [new \PHPFUI\ConstantContact\Definition\StreetAddressPut([
286-
'kind' => 'home',
287-
'street' => 'address',
288-
'city' => 'town',
289-
'state' => 'state',
290-
'postal_code' => 'zip',
291-
'country' => 'USA', ])];
292-
$json = $contactBody->getJSON();
293-
294-
$this->assertStringContainsString('created_at', $json);
295-
}
296296
}

Tool/Generator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ private function deleteFileTree(string $path) : void
240240
if (! $item->isDir())
241241
{
242242
$fileName = "{$item}";
243+
243244
// don't delete base classes
244245
if (! \str_ends_with($fileName, 'Base.php'))
245246
{

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
],
1414
"require": {
15-
"php": ">=8.0 <8.3",
15+
"php": ">=8.0 <8.4",
1616
"guzzlehttp/guzzle": "^7.3",
1717
"spatie/guzzle-rate-limiter-middleware": "^2.0"
1818
},

0 commit comments

Comments
 (0)