*/
class ApplicationControllerTest extends PHPUnit2_Framework_TestCase
{
+ /**
+ * Internal fixture: an instance of ApplicationController
+ * @var object
+ */
protected $fixture;
- public function setUp() {}
+ /**
+ * Repository path
+ * @var string
+ */
+ private $reposPath = 'file:///Server/htdocs/viewsvn/reposdir';
+
+ /**
+ * Binary path
+ * @var string
+ */
+ private $binaryPath = '/usr/local/bin/svn';
+
+ public function setUp()
+ {
+ $this->fixture = new ApplicationController($this->binaryPath, $this->reposPath);
+ }
// ###################################################################
/**
*/
public function testGetRepositoryUri()
{
- throw new PHPUnit2_Framework_IncompleteTestError;
+ $this->assertEquals($this->reposPath, $this->fixture->getRepositoryPath(), 'Repository path is empty');
+ $this->assertRegExp('#(.*)/$#', $this->fixture->getRepositoryPath(), 'Repository path does not end with a slash');
}
// ###################################################################
|| ###################################################################
\*=====================================================================*/
+/**
+* ApplicationController
+*
+* This is the main class that is responsible for routing requests, storing
+* common variables, and managing the backend of the application. It does
+* not, however, deal in processing data.
+*
+* @author Iris Studios, Inc.
+* @copyright Copyright ©2002 - [#]year[#], Iris Studios, Inc.
+* @version $Revision$
+* @package ViewSVN
+*
+*/
+class ApplicationController
+{
+ /**
+ * Subversion binary path
+ * @var string
+ */
+ private $binaryPath;
+
+ /**
+ * Repository name
+ * @var string
+ */
+ private $reposName;
+
+ /**
+ * Repository path
+ * @var string
+ */
+ private $reposPath;
+
+ // ###################################################################
+ /**
+ * Constructor: setup fields
+ *
+ * @param string SVN binary path
+ * @param string Repository path
+ */
+ public function __construct($binaryPath, $reposPath)
+ {
+ $this->reposPath = $reposPath;
+ $this->binaryPath = $binaryPath;
+ }
+
+ // ###################################################################
+ /**
+ * Returns the repository path ($reposPath) variable
+ *
+ * @return string The active repository path
+ */
+ public function getRepositoryPath()
+ {
+ return $this->reposPath;
+ }
+}
+
/*=====================================================================*\
|| ###################################################################
|| # $HeadURL$