DiscordOptions example

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\DiscordOptions;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordAuthorEmbedObject;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordEmbed;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFooterEmbedObject;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordMediaEmbedObject;

final class DiscordOptionsTest extends TestCase
{
    public function testDiscordOptions()
    {
        $discordOptions = (new DiscordOptions())
            ->username('name of the bot')
            ->avatarUrl('http://ava.tar/pic.png')
            ->tts(true);

        $this->assertSame($discordOptions->toArray()[
            'username' => 'name of the bot',
            'avatar_url' => 'http://ava.tar/pic.png',
            'tts' => true,
        ]);
    }

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