TextInput example



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

use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Action\Input\TextInput;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\Test\Action\Input\AbstractInputTestCase;

final class TextInputTest extends AbstractInputTestCase
{
    public function createInput(): TextInput
    {
        return new TextInput();
    }

    public function testIsMultilineWithTrue()
    {
        $input = $this->createInput()
            ->isMultiline(true);

        $this->assertTrue($input->toArray()['isMultiline']);
    }

    public function testIsMultilineWithFalse()
    {

        $action = (new ActionCard())
            ->input($input);

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

    public static function availableInputs(): \Generator
    {
        yield [[['@type' => 'DateInput']]new DateInput()];
        yield [[['@type' => 'TextInput']]new TextInput()];
        yield [[['@type' => 'MultichoiceInput']]new MultiChoiceInput()];
    }

    /** * @dataProvider compatibleActions */
    public function testAction(array $expected, ActionCardCompatibleActionInterface $action)
    {
        $section = (new ActionCard())
            ->action($action);

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