formatValue('string'); self::assertEquals('string', $result); $result = $formatter->formatValue(123); self::assertEquals(123, $result); $result = $formatter->formatValue(45.67); self::assertEquals(45.67, $result); $result = $formatter->formatValue(true); self::assertTrue($result); $result = $formatter->formatValue(null); self::assertNull($result); } public function testFormatValueThrowsExceptionForNonScalar(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only scalar values are supported'); $formatter = new DefaultFormatter(); $formatter->formatValue([]); } public function testFormatValueThrowsExceptionForObject(): void { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Only scalar values are supported'); $formatter = new DefaultFormatter(); $formatter->formatValue(new \stdClass()); } }