iconUrl example

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordAuthorEmbedObject;
use Symfony\Component\Notifier\Exception\LengthException;

final class DiscordAuthorEmbedObjectTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $author = (new DiscordAuthorEmbedObject())
            ->name('Doe')
            ->url('http://ur.l')
            ->iconUrl('http://icon-ur.l')
            ->proxyIconUrl('http://proxy-icon-ur.l');

        $this->assertSame([
            'name' => 'Doe',
            'url' => 'http://ur.l',
            'icon_url' => 'http://icon-ur.l',
            'proxy_icon_url' => 'http://proxy-icon-ur.l',
        ]$author->toArray());
    }

    public function testThrowsWhenNameExceedsCharacterLimit()
    {
use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Discord\Embeds\DiscordFooterEmbedObject;
use Symfony\Component\Notifier\Exception\LengthException;

final class DiscordFooterEmbedObjectTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $author = (new DiscordFooterEmbedObject())
            ->text('foo')
            ->iconUrl('http://icon-ur.l')
            ->proxyIconUrl('http://proxy-icon-ur.l');

        $this->assertSame([
            'text' => 'foo',
            'icon_url' => 'http://icon-ur.l',
            'proxy_icon_url' => 'http://proxy-icon-ur.l',
        ]$author->toArray());
    }

    public function testThrowsWhenTextExceedsCharacterLimit()
    {
        
$discordOptions = (new DiscordOptions())
            ->addEmbed((new DiscordEmbed())
                ->description('descript.io')
                ->url('http://ava.tar/pic.png')
                ->timestamp(new \DateTimeImmutable('2020-10-12 9:14:15+0000'))
                ->color(2021216)
                ->title('New song added!')
                ->footer(
                    (new DiscordFooterEmbedObject())
                        ->text('text')
                        ->iconUrl('icon url')
                        ->proxyIconUrl('proxy icon url')
                )
                ->thumbnail(
                    (new DiscordMediaEmbedObject())
                        ->url('https://thumb.ur.l/')
                        ->proxyUrl('https://proxy.ur.l/')
                        ->height(900)
                        ->width(600)
                )
                ->image(
                    (new DiscordMediaEmbedObject())
                        
Home | Imprint | This part of the site doesn't use cookies.