Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
brendt committed May 8, 2024
1 parent da1b232 commit 2180843
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Unit/Mapper/Mappers/JsonToObjectMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Tests\Tempest\Unit\Mapper\Mappers;

use Tempest\Mapper\Mappers\JsonToObjectMapper;
use function Tempest\map;
use Tests\Tempest\IntegrationTest;
use Tests\Tempest\Unit\Mapper\Fixtures\ObjectA;
Expand All @@ -21,4 +22,18 @@ public function test_json_to_object(): void
$this->assertSame('a', $object->a);
$this->assertSame('b', $object->b);
}

public function test_invalid_json(): void
{
$mapper = new JsonToObjectMapper();

$this->assertFalse($mapper->canMap('invalid', ObjectA::class));
}

public function test_invalid_object(): void
{
$mapper = new JsonToObjectMapper();

$this->assertFalse($mapper->canMap('{}', 'unknown'));
}
}

0 comments on commit 2180843

Please sign in to comment.