Skip to content

Commit

Permalink
Add passing unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinleblanc committed Sep 14, 2016
1 parent 88bc489 commit 52d9ccf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions assets/hello.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SGVsbG8gV29ybGQh
29 changes: 12 additions & 17 deletions tests/new_unit_tests/Commands/ArtCommandTest.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
<?php

namespace Pantheon\Terminus\UnitTests\Commands;

use Codeception\Specify;
use Pantheon\Terminus\Commands\ArtCommand;
use Pantheon\Terminus\Config;

use Pantheon\Terminus\Tests\CommandTestCase;
use Symfony\Component\Console\Output\BufferedOutput;

/**
* Testing class for Pantheon\Terminus\Terminus
*/
class ArtCommandTest extends \PHPUnit_Framework_TestCase
class ArtCommandTest extends CommandTestCase
{
/**
* @var ArtCommand
*/
private $command;

public function setUp()
{
$config = new Config([]);
$this->command = new ArtCommand();
$this->command->setConfig($config);
parent::setUp();
$this->setInput(['command' => 'art', 'name' => 'hello']);
}

public function testArtPrintsArt()
{
assertEquals(file_get)
$this->assertEquals('Hello World!', $this->runCommand()->getOutput());
}

public function testArtRejectsNonExistantFiles()
{
$this->setInput(['command' => 'art', 'name' => 'foo']);
$this->assertEquals('Not a valid work of art!', $this->runCommand()->getOutput());
}
}

0 comments on commit 52d9ccf

Please sign in to comment.