/** * Returns the email id to match against a cid in an email body * @param ImapBodyPart $section * @return string */ private function getCid(ImapBodyPart $section) { return preg_quote(preg_replace(['/^</', '/>$/'], '', $section->getId())); }
/** * @test */ public function it_converts_the_object_to_a_string() { $bodyPart = new ImapBodyPart('foo', 'bar', 'baz', 'qux', 'quux', 'corge', 'grault'); $this->assertEquals('{"bodyType":"foo","encoding":"bar","subType":"baz","section":"qux","charset":"quux","name":"corge","id":"grault"}', $bodyPart->__toString()); }