From f4c5f6280792f1e959bb4e8d0ef1f7f613e7f54e Mon Sep 17 00:00:00 2001 From: Craig Davis Date: Sun, 12 Jan 2014 15:21:20 -0700 Subject: [PATCH] Add initial travis support to the repository --- .travis.yml | 9 +++++++++ tests/ListCommandTest.php | 22 ++++++++++++++++++++++ tests/VersionCommandTest.php | 20 ++++++++++++++++++++ tests/bootstrap.php | 23 +++++++++++++++++++++++ 4 files changed, 74 insertions(+) create mode 100644 .travis.yml create mode 100644 tests/ListCommandTest.php create mode 100644 tests/VersionCommandTest.php create mode 100644 tests/bootstrap.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4079992 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: php + +before_script: + - curl -s http://getcomposer.org/installer | php + - php composer.phar install --dev + +php: + - 5.3 + - 5.4 diff --git a/tests/ListCommandTest.php b/tests/ListCommandTest.php new file mode 100644 index 0000000..f23ce58 --- /dev/null +++ b/tests/ListCommandTest.php @@ -0,0 +1,22 @@ +console->find('list'); + $commandTester = new CommandTester($command); + $commandTester->execute(array( + 'command' => $command->getName() + )); + $this->assertRegExp('/Available commands/', $commandTester->getDisplay()); + $this->assertRegExp('/Options/', $commandTester->getDisplay()); + $this->assertRegExp('/list/', $commandTester->getDisplay()); + } +} + + +/* End of file ListCommandTest.php */ diff --git a/tests/VersionCommandTest.php b/tests/VersionCommandTest.php new file mode 100644 index 0000000..eda1990 --- /dev/null +++ b/tests/VersionCommandTest.php @@ -0,0 +1,20 @@ +console->find('version'); + $commandTester = new CommandTester($command); + $commandTester->execute(array( + 'command' => $command->getName() + )); + $this->assertEquals($this->console->project->version, trim($commandTester->getDisplay())); + } +} + + +/* End of file VersionCommandTest.php */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..91b73a8 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,23 @@ +add('Resume', __DIR__ . '/../src'); + +use Resume\Cli\Resume; + +class ResumeTest extends \PHPUnit_Framework_TestCase +{ + + public $console; + + public function setUp() + { + $templatePath = realpath(__DIR__ . '/../templates/'); + $consoleTemplatePath = realpath(__DIR__ . '/../src/Resume/Templates'); + $project = json_decode(file_get_contents(__DIR__ . '/../composer.json')); + $this->console = new Resume(); + $this->console->initialize($templatePath, $consoleTemplatePath, $project); + } +} + +/* End file bootstrap.php */