예제 #1
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('connection:list');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+----+--------+
| ID | Name   |
+----+--------+
| 1  | Native |
+----+--------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #2
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('action:detail');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName(), 'class' => 'Fusio\\Adapter\\Util\\Action\\UtilStaticResponse']);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+------------+----------+----------------------------------------+
| Name       | Type     | Details                                |
+------------+----------+----------------------------------------+
| statusCode | Select   | 100: Continue, 101: Switching Pr [...] |
| response   | TextArea | json                                   |
+------------+----------+----------------------------------------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #3
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('connection:class');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+---------------------------+-------------------------------------------+
| Name                      | Class                                     |
+---------------------------+-------------------------------------------+
| SQL-Connection            | Fusio\\Adapter\\Sql\\Connection\\DBAL         |
| SQL-Connection (advanced) | Fusio\\Adapter\\Sql\\Connection\\DBALAdvanced |
+---------------------------+-------------------------------------------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #4
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('action:class');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+----------------------+----------------------------------------------+
| Name                 | Class                                        |
+----------------------+----------------------------------------------+
| SQL-Table            | Fusio\\Adapter\\Sql\\Action\\SqlTable            |
| Util-Static-Response | Fusio\\Adapter\\Util\\Action\\UtilStaticResponse |
| V8-Processor         | Fusio\\Adapter\\V8\\Action\\V8Processor          |
+----------------------+----------------------------------------------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #5
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('user:list');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+----+---------------+
| ID | Name          |
+----+---------------+
| 4  | Developer     |
| 3  | Disabled      |
| 2  | Consumer      |
| 1  | Administrator |
+----+---------------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #6
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('app:list');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName()]);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+----+----------+
| ID | Name     |
+----+----------+
| 4  | Pending  |
| 3  | Foo-App  |
| 2  | Consumer |
| 1  | Backend  |
+----+----------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }
예제 #7
0
    public function testCommand()
    {
        $command = Environment::getService('console')->find('connection:detail');
        $commandTester = new CommandTester($command);
        $commandTester->execute(['command' => $command->getName(), 'class' => 'Fusio\\Adapter\\Sql\\Connection\\DBAL']);
        $actual = $commandTester->getDisplay();
        $expect = <<<TEXT
+----------+--------+----------------------------------------+
| Name     | Type   | Details                                |
+----------+--------+----------------------------------------+
| type     | Select | pdo_mysql: MySQL, pdo_pgsql: Pos [...] |
| host     | Input  | text                                   |
| username | Input  | text                                   |
| password | Input  | password                               |
| database | Input  | text                                   |
+----------+--------+----------------------------------------+

TEXT;
        Assert::assertEqualsIgnoreWhitespace($expect, $actual);
    }