Started with a unit test for the monotone interface.

Main test infrastructure is there, still lots of functionality left
for testing. Fixed a possible bug in the SCM interface already:
Pluf_HTTP_Response_NotFound needs a request instance as ctor argument,
which we don't have at this point, therefor we just throw an exception.
This commit is contained in:
Thomas Keller
2011-04-06 02:59:26 +02:00
parent 12d3eef3d1
commit fb62061e5a
2 changed files with 251 additions and 2 deletions

View File

@@ -135,13 +135,13 @@ class IDF_Scm_Monotone extends IDF_Scm
/**
* @see IDF_Scm::getArchiveStream
*/
public function getArchiveStream($commit, $prefix='repository/')
public function getArchiveStream($commit, $prefix = null)
{
$revs = $this->_resolveSelector($commit);
// sanity: this should actually not happen, because the
// revision is validated before already
if (count($revs) == 0) {
return new Pluf_HTTP_Response_NotFound();
throw new IDF_Scm_Exception("$commit is not a valid revision");
}
return new IDF_Scm_Monotone_ZipRender($this->stdio, $revs[0]);
}