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

@@ -21,6 +21,8 @@
#
# ***** END LICENSE BLOCK ***** */
require_once 'IDF/Scm/Monotone/IStdio.php';
/**
* Monotone stdio class
*
@@ -29,7 +31,7 @@
*
* @author Thomas Keller <me@thomaskeller.biz>
*/
class IDF_Scm_Monotone_Stdio
class IDF_Scm_Monotone_Stdio implements IDF_Scm_Monotone_IStdio
{
/** this is the most recent STDIO version. The number is output
at the protocol start. Older versions of monotone (prior 0.47)
@@ -68,7 +70,7 @@ class IDF_Scm_Monotone_Stdio
*
* @return string
*/
public function _getAuthOptions()
private function _getAuthOptions()
{
$prjconf = $this->project->getConf();
$name = $prjconf->getVal('mtn_client_key_name', false);