InvokeAddInCommandAction example



namespace Symfony\Component\Notifier\Bridge\MicrosoftTeams\Tests\Action;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\InvokeAddInCommandAction;

final class InvokeAddInCommandActionTest extends TestCase
{
    public function testName()
    {
        $action = (new InvokeAddInCommandAction())
            ->name($value = 'My name');

        $this->assertSame($value$action->toArray()['name']);
    }

    public function testAddInId()
    {
        $action = (new InvokeAddInCommandAction())
            ->addInId($value = '1234');

        $this->assertSame($value$action->toArray()['addInId']);
    }
$section = (new Section())
            ->action($action);

        $this->assertCount(1, $section->toArray()['potentialAction']);
        $this->assertSame($expected$section->toArray()['potentialAction']);
    }

    public static function allowedActions(): \Generator
    {
        yield [[['@type' => 'ActionCard']]new ActionCard()];
        yield [[['@type' => 'HttpPOST']]new HttpPostAction()];
        yield [[['@type' => 'InvokeAddInCommand']]new InvokeAddInCommandAction()];
        yield [[['@type' => 'OpenUri']]new OpenUriAction()];
    }

    public function testActivity()
    {
        $activity = (new Activity())
            ->image($imageUrl = 'https://symfony.com/logo.png')
            ->title($title = 'Activities')
            ->subtitle($subtitle = 'for Admins only')
            ->text($text = 'Hey Symfony!');

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