2014-05-10 20:28:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class AbstractCommandTest extends PHPUnit_Framework_TestCase
|
|
|
|
{
|
|
|
|
public function tearDown()
|
|
|
|
{
|
|
|
|
Mockery::close();
|
|
|
|
}
|
|
|
|
|
2014-05-14 17:35:17 +02:00
|
|
|
public function testArgument()
|
2014-05-10 20:28:08 +02:00
|
|
|
{
|
|
|
|
$command = $this->getTestCommand();
|
2014-05-14 17:35:17 +02:00
|
|
|
$this->assertEquals('foo', $command->argument(0)->value());
|
|
|
|
$this->assertEquals('bar', $command->argument(1)->value());
|
2014-05-10 20:28:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetOutput()
|
|
|
|
{
|
|
|
|
$command = $this->getTestCommand();
|
|
|
|
$command->setOutput('foo');
|
|
|
|
$this->assertEquals('foo', $command->getOutput());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testHasOutput()
|
|
|
|
{
|
|
|
|
$command = $this->getTestCommand();
|
|
|
|
$this->assertEquals(false, $command->hasOutput());
|
|
|
|
$command->setOutput('foo');
|
|
|
|
$this->assertEquals(true, $command->hasOutput());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetOutput()
|
|
|
|
{
|
|
|
|
$command = $this->getTestCommand();
|
|
|
|
$command->setOutput('foo');
|
|
|
|
$this->assertEquals(true, $command->hasOutput());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getTestCommand()
|
|
|
|
{
|
|
|
|
$arguments = array('foo', 'bar');
|
|
|
|
$command = $this->getMockForAbstractClass('\Intervention\Image\Commands\AbstractCommand', array($arguments));
|
|
|
|
|
|
|
|
return $command;
|
|
|
|
}
|
|
|
|
}
|