Update to PHP 8.4, new option lib

This commit is contained in:
2024-09-30 23:39:23 -04:00
parent df436c9ef4
commit 4b29345dc7
16 changed files with 151 additions and 151 deletions

View File

@@ -47,7 +47,7 @@ class DocumentMapperTest extends TestCase
#[TestDox('map() succeeds with valid JSON')]
public function testMapSucceedsWithValidJSON(): void
{
$doc = (new DocumentMapper(TestDocument::class))->map(['data' => '{"id":7,"subDoc":{"id":22,"name":"tester"}}']);
$doc = new DocumentMapper(TestDocument::class)->map(['data' => '{"id":7,"subDoc":{"id":22,"name":"tester"}}']);
$this->assertNotNull($doc, 'The document should not have been null');
$this->assertEquals(7, $doc->id, 'ID not filled correctly');
$this->assertNotNull($doc->subDoc, 'The sub-document should not have been null');
@@ -58,7 +58,7 @@ class DocumentMapperTest extends TestCase
#[TestDox('map() succeeds with valid JSON for Pjson class')]
public function testMapSucceedsWithValidJSONForPjsonClass(): void
{
$doc = (new DocumentMapper(PjsonDocument::class))->map(['data' => '{"id":"seven","name":"bob","num_value":8}']);
$doc = new DocumentMapper(PjsonDocument::class)->map(['data' => '{"id":"seven","name":"bob","num_value":8}']);
$this->assertNotNull($doc, 'The document should not have been null');
$this->assertEquals(new PjsonId('seven'), $doc->id, 'ID not filled correctly');
$this->assertEquals('bob', $doc->name, 'Name not filled correctly');
@@ -70,13 +70,13 @@ class DocumentMapperTest extends TestCase
public function testMapFailsWithInvalidJSON(): void
{
$this->expectException(DocumentException::class);
(new DocumentMapper(TestDocument::class))->map(['data' => 'this is not valid']);
new DocumentMapper(TestDocument::class)->map(['data' => 'this is not valid']);
}
#[TestDox('map() fails with invalid JSON for Pjson class')]
public function testMapFailsWithInvalidJSONForPjsonClass(): void
{
$this->expectException(DocumentException::class);
(new DocumentMapper(PjsonDocument::class))->map(['data' => 'not even close']);
new DocumentMapper(PjsonDocument::class)->map(['data' => 'not even close']);
}
}