1
0
mirror of https://github.com/Intervention/image.git synced 2025-02-24 22:22:32 +01:00
intervention_image/tests/AbstractCommandTest.php
2017-09-02 21:24:22 +02:00

47 lines
1.2 KiB
PHP

<?php
class AbstractCommandTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
Mockery::close();
}
public function testArgument()
{
$command = $this->getTestCommand();
$this->assertEquals('foo', $command->argument(0)->value());
$this->assertEquals('bar', $command->argument(1)->value());
}
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 = ['foo', 'bar'];
$command = $this->getMockForAbstractClass('\Intervention\Image\Commands\AbstractCommand', [$arguments]);
return $command;
}
}