<?php

namespace Pantheon\Terminus\Tests\Functional;

use Pantheon\Terminus\Tests\Traits\LoginHelperTrait;
use Pantheon\Terminus\Tests\Traits\TerminusTestTrait;
use PHPUnit\Framework\TestCase;

/**
 * Class RemoteCommandsTest
 *
 * @package Pantheon\Terminus\Tests\Functional
 */
class RemoteCommandsTest extends TestCase
{
    use TerminusTestTrait;
    use LoginHelperTrait;

    /**
     * @test
     * @covers \Pantheon\Terminus\Commands\Remote\DrushCommand
     * @covers \Pantheon\Terminus\Commands\Remote\WPCommand
     *
     * @group remote
     * @group todo
     */
    public function testConnection()
    {
        $this->fail("To Be Written");
    }
}

<?php

namespace Pantheon\Terminus\Tests\Functional;

use Pantheon\Terminus\Tests\Traits\LoginHelperTrait;
use Pantheon\Terminus\Tests\Traits\TerminusTestTrait;
use PHPUnit\Framework\TestCase;

/**
 * Class RemoteCommandsTest
 *
 * @package Pantheon\Terminus\Tests\Functional
 */
class RemoteCommandsTest extends TestCase
{
    use TerminusTestTrait;
    use LoginHelperTrait;

    /**
     * {@inheritdoc}
     *
     * @throws \Exception
     */
    protected function setUp(): void
    {
        if (!$this->isSiteFrameworkDrupal()) {
            $this->markTestSkipped(
                'A Drupal-based test site is required to test remote Drush commands.'
            );
        }
    }

    /**
     * @test
     * @covers \Pantheon\Terminus\Commands\Remote\DrushCommand
     * @covers \Pantheon\Terminus\Commands\Remote\WPCommand
     *
     * @group remote
     * @group short
     */
    public function testDrushCommands()
    {
        // @todo: change env to 'dev'.
        $commandPrefix = sprintf('drush %s.%s', $this->getSiteName(), 'fix-drush');

        $command = sprintf('%s -- %s', $commandPrefix, 'version');
        $drushVersion = $this->terminusJsonResponse($command);
        $this->assertIsString($drushVersion);
        $this->assertIsInt(preg_match('(^\d{1,2})', $drushVersion, $matches));
        $this->assertGreaterThanOrEqual(8, $matches[0]);

        $command = sprintf('%s -- %s', $commandPrefix, 'status');
        $drushStatus = $this->terminusJsonResponse($command);
        $this->assertIsArray($drushStatus);
        $this->assertTrue(isset($drushStatus['drush-version']));
        $this->assertEquals($drushStatus['drupal-version'], $drushVersion);
    }
}

Add functional tests for Drush commands
Add functional tests for Drush commands
