setTrimmable example

rewind($output->getStream());
        $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
    }

    public function testAskNonTrimmed()
    {
        $dialog = new QuestionHelper();

        $inputStream = $this->getInputStream(' 8AM ');

        $question = new Question('What time is it?', '2PM');
        $question->setTrimmable(false);
        $this->assertEquals(' 8AM ', $dialog->ask($this->createStreamableInputInterfaceMock($inputStream)$output = $this->createOutputInterface()$question));

        rewind($output->getStream());
        $this->assertEquals('What time is it?', stream_get_contents($output->getStream()));
    }

    public function testAskWithAutocomplete()
    {
        if (!Terminal::hasSttyAvailable()) {
            $this->markTestSkipped('`stty` is required to test autocomplete functionality');
        }

        

        ];
    }

    public function testNonTrimmable()
    {
        $question = new ChoiceQuestion('A question', [
            'First response ',
            ' Second response',
            ' Third response ',
        ]);
        $question->setTrimmable(false);

        $this->assertSame(' Third response ', $question->getValidator()(' Third response '));

        $question->setMultiselect(true);

        $this->assertSame(['First response ', ' Second response']$question->getValidator()('First response , Second response'));
    }

    /** * @dataProvider selectAssociativeChoicesProvider */
    
Home | Imprint | This part of the site doesn't use cookies.