Neos\Flow\Tests\Unit\Cli\RequestBuilderTest::CliAccesWithArgumentsWithAndWithoutValuesBuildsCorrectRequest PHP Метод

CliAccesWithArgumentsWithAndWithoutValuesBuildsCorrectRequest() публичный Метод

Checks if a CLI request specifying some mixed "console style" (-c or --my-argument -f=value) arguments with and without values results in the expected request object
    public function CliAccesWithArgumentsWithAndWithoutValuesBuildsCorrectRequest()
    {
        $methodParameters = ['testArgument' => ['optional' => false, 'type' => 'string'], 'testArgument2' => ['optional' => false, 'type' => 'string'], 'testArgument3' => ['optional' => false, 'type' => 'string'], 'testArgument4' => ['optional' => false, 'type' => 'string'], 'testArgument5' => ['optional' => false, 'type' => 'string'], 'testArgument6' => ['optional' => false, 'type' => 'string'], 'testArgument7' => ['optional' => false, 'type' => 'string'], 'f' => ['optional' => false, 'type' => 'string'], 'd' => ['optional' => false, 'type' => 'string'], 'a' => ['optional' => false, 'type' => 'string'], 'c' => ['optional' => false, 'type' => 'string'], 'j' => ['optional' => false, 'type' => 'string'], 'k' => ['optional' => false, 'type' => 'string'], 'm' => ['optional' => false, 'type' => 'string']];
        $this->mockCommandManager->expects($this->once())->method('getCommandMethodParameters')->with('Acme\\Test\\Command\\DefaultCommandController', 'listCommand')->will($this->returnValue($methodParameters));
        $request = $this->requestBuilder->build('acme.test:default:list --test-argument=value --test-argument2= value2 -k --test-argument-3 = value3 --test-argument4=value4 -f valuef -d=valued -a = valuea -c --testArgument7 --test-argument5 = 5 --test-argument6 -j kjk -m');
        $this->assertTrue($request->hasArgument('testArgument'), 'The given "testArgument" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument2'), 'The given "testArgument2" was not found in the built request.');
        $this->assertTrue($request->hasArgument('k'), 'The given "k" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument3'), 'The given "testArgument3" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument4'), 'The given "testArgument4" was not found in the built request.');
        $this->assertTrue($request->hasArgument('f'), 'The given "f" was not found in the built request.');
        $this->assertTrue($request->hasArgument('d'), 'The given "d" was not found in the built request.');
        $this->assertTrue($request->hasArgument('a'), 'The given "a" was not found in the built request.');
        $this->assertTrue($request->hasArgument('c'), 'The given "d" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument7'), 'The given "testArgument7" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument5'), 'The given "testArgument5" was not found in the built request.');
        $this->assertTrue($request->hasArgument('testArgument6'), 'The given "testArgument6" was not found in the built request.');
        $this->assertTrue($request->hasArgument('j'), 'The given "j" was not found in the built request.');
        $this->assertTrue($request->hasArgument('m'), 'The given "m" was not found in the built request.');
        $this->assertSame($request->getArgument('testArgument'), 'value', 'The "testArgument" had not the given value.');
        $this->assertSame($request->getArgument('testArgument2'), 'value2', 'The "testArgument2" had not the given value.');
        $this->assertSame($request->getArgument('testArgument3'), 'value3', 'The "testArgument3" had not the given value.');
        $this->assertSame($request->getArgument('testArgument4'), 'value4', 'The "testArgument4" had not the given value.');
        $this->assertSame($request->getArgument('f'), 'valuef', 'The "f" had not the given value.');
        $this->assertSame($request->getArgument('d'), 'valued', 'The "d" had not the given value.');
        $this->assertSame($request->getArgument('a'), 'valuea', 'The "a" had not the given value.');
        $this->assertSame($request->getArgument('testArgument5'), '5', 'The "testArgument4" had not the given value.');
        $this->assertSame($request->getArgument('j'), 'kjk', 'The "j" had not the given value.');
    }