ActionCard example

public function testAction(array $expected, ActionInterface $action)
    {
        $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')
            
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\HttpPostAction;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\DateInput;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\InputInterface;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\MultiChoiceInput;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\TextInput;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\OpenUriAction;

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

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

    /** * @dataProvider availableInputs */
    public function testInput(array $expected, InputInterface $input)
    {
        $action = (new ActionCard())
            
Home | Imprint | This part of the site doesn't use cookies.