1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-09 05:30:40 +02:00

added "array" argument type

This commit is contained in:
Oliver Vogel
2014-07-27 11:40:50 +02:00
parent 45099a0c78
commit 837983c825
2 changed files with 25 additions and 0 deletions

View File

@@ -69,6 +69,26 @@ class ArgumentTest extends PHPUnit_Framework_TestCase
$arg->type('integer');
}
public function testTypeArrayPass()
{
$arg = new Argument($this->getMockedCommand(array()));
$arg->type('array');
$this->validateArgument($arg, null);
$arg = new Argument($this->getMockedCommand(array(array(1,2,3))));
$arg->type('array');
$this->validateArgument($arg, array(1,2,3));
}
/**
* @expectedException \Intervention\Image\Exception\InvalidArgumentException
*/
public function testTypeArrayFail()
{
$arg = new Argument($this->getMockedCommand(array('foo')));
$arg->type('array');
}
public function testTypeDigitPass()
{
$arg = new Argument($this->getMockedCommand(array()));