Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
[zendframework/zendframework#5933] Use dataProvider for new test
Browse files Browse the repository at this point in the history
  • Loading branch information
weierophinney committed Mar 7, 2014
1 parent 0d167fb commit cbb433a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions test/Server/ErrorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,22 @@ public function testCodeShouldAllowArbitraryAppErrorCodesInXmlRpcErrorCodeRange(
}
}

public function testCodeShouldAllowArbitraryErrorCode()
public function arbitraryErrorCodes()
{
foreach(array(1000, 404, -3000) as $code) {
$this->error->setCode($code);
$this->assertEquals($code, $this->error->getCode());
}
return array(
'1000' => array(1000),
'404' => array(404),
'-3000' => array(-3000),
);
}

/**
* @dataProvider arbitraryErrorCodes
*/
public function testCodeShouldAllowArbitraryErrorCode($code)
{
$this->error->setCode($code);
$this->assertEquals($code, $this->error->getCode());
}

public function testMessageShouldBeNullByDefault()
Expand Down

0 comments on commit cbb433a

Please sign in to comment.