|
@@ -32,6 +32,7 @@ class SpdxLicenseIdentifierTest extends TestCase
|
|
|
{
|
|
|
return array(
|
|
|
array(""),
|
|
|
+ array(array()),
|
|
|
array("The system pwns you"),
|
|
|
array("()"),
|
|
|
array("(MIT)"),
|
|
@@ -50,6 +51,17 @@ class SpdxLicenseIdentifierTest extends TestCase
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ public static function provideInvalidArgument()
|
|
|
+ {
|
|
|
+ return array(
|
|
|
+ array(null),
|
|
|
+ array(new \stdClass),
|
|
|
+ array(array(new \stdClass)),
|
|
|
+ array(array("mixed", new \stdClass)),
|
|
|
+ array(array(new \stdClass, new \stdClass)),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @dataProvider provideValidLicenses
|
|
|
* @param $license
|
|
@@ -71,11 +83,12 @@ class SpdxLicenseIdentifierTest extends TestCase
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * @dataProvider provideInvalidArgument
|
|
|
* @expectedException InvalidArgumentException
|
|
|
*/
|
|
|
- public function testInvalidArgument()
|
|
|
+ public function testInvalidArgument($invalidArgument)
|
|
|
{
|
|
|
$validator = new SpdxLicenseIdentifier();
|
|
|
- $validator->validate(null);
|
|
|
+ $validator->validate($invalidArgument);
|
|
|
}
|
|
|
}
|