<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/index.php?action=history&amp;feed=atom&amp;title=Talk%3AUnit_Testing_--_a_Simple_Example</id>
	<title>Talk:Unit Testing -- a Simple Example - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/index.php?action=history&amp;feed=atom&amp;title=Talk%3AUnit_Testing_--_a_Simple_Example"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Unit_Testing_--_a_Simple_Example&amp;action=history"/>
	<updated>2026-05-16T06:58:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Unit_Testing_--_a_Simple_Example&amp;diff=7396&amp;oldid=prev</id>
		<title>Pollen8 at 14:06, 29 May 2008</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Unit_Testing_--_a_Simple_Example&amp;diff=7396&amp;oldid=prev"/>
		<updated>2008-05-29T14:06:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:06, 29 May 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;im just starting to look at this but the code given in this page didn&amp;#039;t work for me. Instead I had to wrap the setup and test functions inside a class, e.g.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;im just starting to look at this but the code given in this page didn&amp;#039;t work for me. Instead I had to wrap the setup and test functions inside a class, e.g.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[code]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;source lang=&quot;php&quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;?php  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;?php  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l64&quot;&gt;Line 64:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 64:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  ?&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/code&lt;/del&gt;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[&lt;/ins&gt;[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;User:Pollen8|Pollen8]&lt;/ins&gt;] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;10:06, 29 May 2008 (EDT) pollen8&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Pollen8</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Unit_Testing_--_a_Simple_Example&amp;diff=7395&amp;oldid=prev</id>
		<title>Pollen8: New page: im just starting to look at this but the code given in this page didn&#039;t work for me. Instead I had to wrap the setup and test functions inside a class, e.g.  [code] &lt;?php   if (! defined(&#039;...</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Unit_Testing_--_a_Simple_Example&amp;diff=7395&amp;oldid=prev"/>
		<updated>2008-05-29T13:58:33Z</updated>

		<summary type="html">&lt;p&gt;New page: im just starting to look at this but the code given in this page didn&amp;#039;t work for me. Instead I had to wrap the setup and test functions inside a class, e.g.  [code] &amp;lt;?php   if (! defined(&amp;#039;...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;im just starting to look at this but the code given in this page didn&amp;#039;t work for me. Instead I had to wrap the setup and test functions inside a class, e.g.&lt;br /&gt;
&lt;br /&gt;
[code]&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
&lt;br /&gt;
if (! defined(&amp;#039;JUNIT_MAIN_METHOD&amp;#039;)) {&lt;br /&gt;
	define(&amp;#039;JUNIT_MAIN_METHOD&amp;#039;, &amp;#039;JRequestTest_GetMethod::main&amp;#039;);&lt;br /&gt;
	$JUnit_home = DIRECTORY_SEPARATOR . &amp;#039;unittest&amp;#039; . DIRECTORY_SEPARATOR;&lt;br /&gt;
	if (($JUnit_posn = strpos(__FILE__, $JUnit_home)) === false) {&lt;br /&gt;
		die(&amp;#039;Unable to find &amp;#039; . $JUnit_home . &amp;#039; in path.&amp;#039;);&lt;br /&gt;
	}&lt;br /&gt;
	$JUnit_posn += strlen($JUnit_home) - 1;&lt;br /&gt;
	$JUnit_root = substr(__FILE__, 0, $JUnit_posn);&lt;br /&gt;
	$JUnit_start = substr(&lt;br /&gt;
		__FILE__,&lt;br /&gt;
		$JUnit_posn + 1,&lt;br /&gt;
		strlen(__FILE__) - strlen(basename(__FILE__)) - $JUnit_posn - 2&lt;br /&gt;
	);&lt;br /&gt;
	require_once $JUnit_root . DIRECTORY_SEPARATOR . &amp;#039;setup.php&amp;#039;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 * Now load the Joomla environment&lt;br /&gt;
 */&lt;br /&gt;
if (! defined(&amp;#039;_JEXEC&amp;#039;)) {&lt;br /&gt;
	define(&amp;#039;_JEXEC&amp;#039;, 1);&lt;br /&gt;
}&lt;br /&gt;
require_once JPATH_BASE . &amp;#039;/includes/defines.php&amp;#039;;&lt;br /&gt;
/*&lt;br /&gt;
 * Mock classes&lt;br /&gt;
 */&lt;br /&gt;
// (no mocks for this test)&lt;br /&gt;
 &lt;br /&gt;
/*&lt;br /&gt;
 * We now return to our regularly scheduled environment.&lt;br /&gt;
 */&lt;br /&gt;
require_once JPATH_LIBRARIES . &amp;#039;/joomla/import.php&amp;#039;;&lt;br /&gt;
 &lt;br /&gt;
jimport( &amp;#039;joomla.environment.request&amp;#039; );&lt;br /&gt;
&lt;br /&gt;
class addElementTest_Mode1 extends PHPUnit_Framework_TestCase&lt;br /&gt;
{&lt;br /&gt;
	/**&lt;br /&gt;
	 * Clear the cache&lt;br /&gt;
	 */&lt;br /&gt;
	function setUp() {&lt;br /&gt;
		// Make sure the request hash is clean.&lt;br /&gt;
		$GLOBALS[&amp;#039;_JREQUEST&amp;#039;] = array();&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	function testGetMethod()&lt;br /&gt;
	{&lt;br /&gt;
	&lt;br /&gt;
		$this-&amp;gt;assertEquals(&amp;#039;1&amp;#039;, &amp;#039;1&amp;#039;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Call main() if this source file is executed directly.&lt;br /&gt;
if (JUNIT_MAIN_METHOD == &amp;#039;JRequestTest_GetMethod::main&amp;#039;) {&lt;br /&gt;
	JRequestTest_GetMethod::main();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
 ?&amp;gt;&lt;br /&gt;
[/code]&lt;/div&gt;</summary>
		<author><name>Pollen8</name></author>
	</entry>
</feed>