diff --git a/tests/unit/Statement/StatementTest.php b/tests/unit/Statement/StatementTest.php index e6318fcd..6ac99bbf 100644 --- a/tests/unit/Statement/StatementTest.php +++ b/tests/unit/Statement/StatementTest.php @@ -61,28 +61,6 @@ public function validConstructorArgumentsProvider() { ); } - /** - * @dataProvider invalidConstructorArgumentsProvider - * @expectedException InvalidArgumentException - */ - public function testConstructorWithInvalidArguments( - $mainSnak, - $qualifiers, - $references, - $guid - ) { - new Statement( $mainSnak, $qualifiers, $references, $guid ); - } - - public function invalidConstructorArgumentsProvider() { - $snak = new PropertyNoValueSnak( 1 ); - - return array( - array( $snak, null, null, false ), - array( $snak, null, null, 1 ), - ); - } - /** * @dataProvider instanceProvider */ @@ -141,11 +119,32 @@ public function testGuidDoesNotAffectHash() { $this->assertEquals( $statement0->getHash(), $statement1->getHash() ); } - public function testSetInvalidGuidCausesException() { + /** + * @dataProvider invalidGuidProvider + * @expectedException InvalidArgumentException + */ + public function testGivenInvalidGuid_constructorThrowsException( $guid ) { + new Statement( new PropertyNoValueSnak( 1 ), null, null, $guid ); + } + + /** + * @dataProvider invalidGuidProvider + * @expectedException InvalidArgumentException + */ + public function testGivenInvalidGuid_setGuidThrowsException( $guid ) { $statement = new Statement( new PropertyNoValueSnak( 42 ) ); + $statement->setGuid( $guid ); + } - $this->setExpectedException( 'InvalidArgumentException' ); - $statement->setGuid( 42 ); + public function invalidGuidProvider() { + $snak = new PropertyNoValueSnak( 1 ); + + return array( + array( false ), + array( 1 ), + array( $snak ), + array( new Statement( $snak ) ), + ); } public function instanceProvider() {