for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bowerphp\Test\Command;
use Bowerphp\Factory\CommandFactory;
use PHPUnit\Framework\TestCase;
/**
* @group functional
*/
class SearchCommandTest extends TestCase
{
* @test
public function shouldExecute()
//when
$commandTester = CommandFactory::tester('search', ['name' => 'smart']);
//then
$this->assertRegExp('/Search results/', $commandTester->getDisplay());
$this->assertRegExp('/js-geo.git/', $commandTester->getDisplay());
}
public function shouldWriteNoResultWhenNoPackageFound()
$commandTester = CommandFactory::tester('search', ['name' => 'unexistant']);
$this->assertRegExp('/No results/', $commandTester->getDisplay());
* @expectedException \RuntimeException
* @expectedExceptionMessage Not enough arguments
public function shouldThrowExceptionWhenNoPackagePass()
CommandFactory::tester('search');