DiscordAuthorEmbedObject example

->height(900)
                        ->width(600)
                )
                ->image(
                    (new DiscordMediaEmbedObject())
                        ->url('https://image.ur.l/')
                        ->proxyUrl('https://proxy.ur.l/')
                        ->height(900)
                        ->width(600)
                )
                ->author(
                    (new DiscordAuthorEmbedObject())
                        ->name('name field')
                        ->url('https://ur.l/')
                        ->iconUrl('https://icon.ur.l/')
                        ->proxyIconUrl('https://proxy.ic.on/url')
                )
            );

        $this->assertSame($discordOptions->toArray()[
            'embeds' => [
                [
                    'description' => 'descript.io',
                    
namespace Symfony\Component\Notifier\Bridge\Discord\Tests\Embeds;

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());
    }
Home | Imprint | This part of the site doesn't use cookies.