Modified:
branches/1.0/CHANGELOG
branches/1.0/src/testing/AgaviFlowTestCase.class.php
branches/1.0/src/testing/AgaviFragmentTestCase.class.php
branches/1.0/src/testing/AgaviUnitTestCase.class.php
Log:
Configurable context for AgaviFlowTestCase (and a little bit of apidoc cleanup), closes #1465
Modified: branches/1.0/CHANGELOG
===================================================================
--- branches/1.0/CHANGELOG 2011-12-14 20:55:56 UTC (rev 4897)
+++ branches/1.0/CHANGELOG 2011-12-14 21:51:42 UTC (rev 4898)
@@ -4,6 +4,8 @@
1.0.7 (December ??, 2011)
-------------------------
+ADD: Configurable context for AgaviFlowTestCase (#1465) (David)
+
CHG: Redesign welcome page (#1464) (David)
Modified: branches/1.0/src/testing/AgaviFlowTestCase.class.php
===================================================================
--- branches/1.0/src/testing/AgaviFlowTestCase.class.php 2011-12-14 20:55:56 UTC (rev 4897)
+++ branches/1.0/src/testing/AgaviFlowTestCase.class.php 2011-12-14 21:51:42 UTC (rev 4898)
@@ -31,6 +31,11 @@
abstract class AgaviFlowTestCase extends AgaviPhpUnitTestCase implements AgaviIFlowTestCase
{
/**
+ * @var string the name of the context to use, null for default context
+ */
+ protected $contextName = null;
+
+ /**
* @var string the fake routing input
*/
protected $input;
@@ -63,6 +68,18 @@
$this->setRunTestInSeparateProcess(true);
}
+ /**
+ * Return the context defined for this test (or the default one).
+ *
+ * @return AgaviContext The context instance defined for this test.
+ *
+ * @author David Zülke <david....@bitextender.com>
+ * @since 1.0.7
+ */
+ public function getContext()
+ {
+ return AgaviContext::getInstance($this->contextName);
+ }
/**
* dispatch the request
Modified: branches/1.0/src/testing/AgaviFragmentTestCase.class.php
===================================================================
--- branches/1.0/src/testing/AgaviFragmentTestCase.class.php 2011-12-14 20:55:56 UTC (rev 4897)
+++ branches/1.0/src/testing/AgaviFragmentTestCase.class.php 2011-12-14 21:51:42 UTC (rev 4898)
@@ -30,7 +30,6 @@
*/
abstract class AgaviFragmentTestCase extends AgaviPhpUnitTestCase implements AgaviIFragmentTestCase
{
-
/**
* @var string the name of the context to use, null for default context
*/
@@ -99,10 +98,10 @@
}
/**
- * retrieve the application context
+ * Return the context defined for this test (or the default one).
+ *
+ * @return AgaviContext The context instance defined for this test.
*
- * @return AgaviContext the application context
- *
* @author Felix Gilcher <felix....@bitextender.com>
* @since 1.0.0
*/
Modified: branches/1.0/src/testing/AgaviUnitTestCase.class.php
===================================================================
--- branches/1.0/src/testing/AgaviUnitTestCase.class.php 2011-12-14 20:55:56 UTC (rev 4897)
+++ branches/1.0/src/testing/AgaviUnitTestCase.class.php 2011-12-14 21:51:42 UTC (rev 4898)
@@ -30,8 +30,11 @@
*/
abstract class AgaviUnitTestCase extends AgaviPhpUnitTestCase implements AgaviIUnitTestCase
{
+ /**
+ * @var string the name of the context to use, null for default context
+ */
protected $contextName = null;
-
+
/**
* Constructs a test case with the given name.
*
@@ -44,10 +47,17 @@
parent::__construct($name, $data, $dataName);
$this->setRunTestInSeparateProcess(true);
}
-
+
+ /**
+ * Return the context defined for this test (or the default one).
+ *
+ * @return AgaviContext The context instance defined for this test.
+ *
+ * @author Felix Gilcher <felix....@bitextender.com>
+ * @since 1.0.0
+ */
public function getContext()
{
return AgaviContext::getInstance($this->contextName);
}
-
}
\ No newline at end of file
_______________________________________________
Agavi Commits Mailing List
com...@lists.agavi.org
http://lists.agavi.org/mailman/listinfo/commits