Exemplo n.º 1
0
    public function testTypeAccessor()
    {
        $mail = new Mail\Mail();
        $this->assertNull($mail->getType());

        $mail->setType(Mime\Mime::MULTIPART_ALTERNATIVE);
        $this->assertEquals(Mime\Mime::MULTIPART_ALTERNATIVE, $mail->getType());

        $mail->setType(Mime\Mime::MULTIPART_RELATED);
        $this->assertEquals(Mime\Mime::MULTIPART_RELATED, $mail->getType());

        try {
            $mail->setType('text/plain');
            $this->fail('Invalid Mime type should throw an exception');
        } catch (\Exception $e) {
        }
    }