Prepare the Stdio class for easier testing.

- create an interface that describes the basic methods
- let the real stdio class implement this interface
- inject the stdio instance into IDF_Scm_Monotone and do not
  create it in the constructor
- ensure in IDF_Scm_Monotone_ZipRender that we get the proper
  constructor arguments
On a slighly unrelated note, make _getAuthOptions() in the stdio
implementation private.
This commit is contained in:
Thomas Keller
2011-03-23 00:47:17 +01:00
parent 5b5705fe90
commit 78a0402351
4 changed files with 79 additions and 10 deletions

View File

@@ -24,7 +24,7 @@
require_once(IDF_PATH.'/../contrib/zipstream-php-0.2.2/zipstream.php');
/**
* Special response object to output
* Special response object to output
*
* The Content-Length will not be set as it is not possible to predict it.
*
@@ -45,7 +45,7 @@ class IDF_Scm_Monotone_ZipRender extends Pluf_HTTP_Response
private $stdio = null;
private $revision = null;
function __construct($stdio, $revision)
function __construct(IDF_Scm_Monotone_IStdio $stdio, $revision)
{
parent::__construct($revision, 'application/x-zip');
$this->stdio = $stdio;