Update to PHP 8.4, new option lib
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user