public function testConvertToString() { $key = 'somekey'; $algorithm = 'H256'; $type = 'mytype'; $header = new Header($key, $algorithm, $type); $this->assertEquals((string) $header, '{"typ":"' . $type . '","alg":"' . $algorithm . '"}'); }