SlackImageBlockElement example

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackImageBlockElement;
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackSectionBlock;

final class SlackSectionBlockTest extends TestCase
{
    public function testCanBeInstantiated()
    {
        $section = new SlackSectionBlock();
        $section->text('section text');
        $section->field('section field');
        $section->accessory(new SlackImageBlockElement('https://example.com/image.jpg', 'an image'));

        $this->assertSame([
            'type' => 'section',
            'text' => [
                'type' => 'mrkdwn',
                'text' => 'section text',
            ],
            'fields' => [
                [
                    'type' => 'mrkdwn',
                    'text' => 'section field',
                ],
Home | Imprint | This part of the site doesn't use cookies.