Clinner\Command\Tests\CommandTest::testStaticFromStringManyCommands PHP Метод

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

    public function testStaticFromStringManyCommands()
    {
        $commandString = 'cat ~/test.html | tr -s " " | cut -d: -f2 | wc';
        $commandsCount = 4;
        $command = Command::fromString($commandString);
        $this->assertInstanceOf('\\Clinner\\Command\\Command', $command);
        // Test that the inverse function also works
        $this->assertEquals($commandString, $command->toCommandString(true));
        $count = 0;
        while (null !== $command) {
            $count++;
            $command = $command->getPipedCommand();
        }
        $this->assertEquals($commandsCount, $count);
    }