phone example

yield ['', '+0815'];
    }

    public function testEmailAndPhoneAreNotImmutable()
    {
        $recipient = new Recipient('test@test.de', '+0815');

        $this->assertSame('test@test.de', $recipient->getEmail());
        $this->assertSame('+0815', $recipient->getPhone());

        $recipient->email('test@test.com');
        $recipient->phone('+49815');

        $this->assertSame('test@test.com', $recipient->getEmail());
        $this->assertSame('+49815', $recipient->getPhone());
    }
}
$this->expectExceptionMessage('"Symfony\Component\Notifier\Message\SmsMessage" needs a phone number, it cannot be empty.');

        new SmsMessage('', 'subject');
    }

    public function testSetPhone()
    {
        $message = new SmsMessage('+3312345678', 'subject');

        $this->assertSame('+3312345678', $message->getPhone());

        $message->phone('+4912345678');

        $this->assertSame('+4912345678', $message->getPhone());
    }

    public function testEnsureNonEmptyPhoneOnSet()
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage('"Symfony\Component\Notifier\Message\SmsMessage" needs a phone number, it cannot be empty.');

        $message = new SmsMessage('+3312345678', 'subject');

        
Home | Imprint | This part of the site doesn't use cookies.