<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://gwiki3.thatlinuxbox.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sean+c</id>
		<title>GeeklogWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://gwiki3.thatlinuxbox.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sean+c"/>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/Special:Contributions/Sean_c"/>
		<updated>2026-04-06T11:42:22Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.5</generator>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Geeklog%27s_way_of_doing_things&amp;diff=5685</id>
		<title>Geeklog's way of doing things</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Geeklog%27s_way_of_doing_things&amp;diff=5685"/>
				<updated>2010-02-09T03:28:38Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;All of Geeklog's PHP files are pure PHP. PHP allows you to use PHP as a scripting language embedded in HTML files but this is not how Geeklog does it. All of Geeklog's PHP files must have &amp;lt;?php as the first five characters and end with ?&amp;gt;. Failure to structure your Geeklog files this way will cause session and header errors. Geeklog attempts as much as possible to have only PHP code in the &amp;lt;tt&amp;gt;.php&amp;lt;/tt&amp;gt; files. Two of the conventions used in Geeklog to accomplish this are the use of [[Using Templates and Language Files#Templates|templates]] and [[Using Templates and Language Files#Language Files|language files]].&lt;br /&gt;
&lt;br /&gt;
Time will be well spent by the Geeklog plugin or block developer to become familiar with several Geeklog libraries. The following section outlines the more important or frequently used libraries, functions and standards. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== lib-common.php ==&lt;br /&gt;
&lt;br /&gt;
The Geeklog plugin or block developer should have a good understanding of &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; which contains most of the display routines as well as some other general purpose routines. All of the Geeklog display routines return HTML. They do not contain echos or prints themselves. The way the Geeklog system is designed; you usually put your code between Geeklog display routines. For example: code to display a page would look like this: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$display  = COM_siteHeader();&lt;br /&gt;
$display .= COM_startBlock(&amp;quot;Title of Your Block&amp;quot;);&lt;br /&gt;
$display .= &amp;quot;Some words&amp;quot;;&lt;br /&gt;
$display .= somefunction();&lt;br /&gt;
$display .= COM_endBlock;&lt;br /&gt;
$display .= COM_siteFooter(true);&lt;br /&gt;
echo $display;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A summary of commonly used Geeklog functions are described below but reference the [http://project.geeklog.net/src/Geeklog/_public_html---lib-common.php.html &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; documentation] for further examples. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== lib-security.php ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;lib-security.php&amp;lt;/tt&amp;gt; file contains the interface routines to the security system used in Geeklog. See the [http://project.geeklog.net/src/Geeklog/_system---lib-security.php.html &amp;lt;tt&amp;gt;lib-security.php&amp;lt;/tt&amp;gt; documentation]. There are several SEC type functions that you may want to use in your projects. The table [[Geeklog's way of doing things#Commonly used Geeklog functions|Commonly Used Geeklog Functions]] at the end of this section defines a couple of the more commonly used functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== lib-database.php ==&lt;br /&gt;
&lt;br /&gt;
All database access should take place through the database abstraction in &amp;lt;tt&amp;gt;lib-database.php&amp;lt;/tt&amp;gt; and table names should be accessed through the &amp;lt;code&amp;gt;$_TABLES&amp;lt;/code&amp;gt; array. The table definitions in this array will then include whatever table prefix this site is using.  You should ensure that your plugin or block uses the &amp;lt;code&amp;gt;$_TABLES['mytable']&amp;lt;/code&amp;gt; for all database access related functions.&lt;br /&gt;
&lt;br /&gt;
* Block developers and site admins installing the block need to make sure that any tables needed by a block are added to the &amp;lt;code&amp;gt;$_TABLES&amp;lt;/code&amp;gt; array. Ensure you follow the same standard by using the $_DB_table_prefix. However, you should '''not''' edit &amp;lt;tt&amp;gt;lib-database.php&amp;lt;/tt&amp;gt;. If no suitable place can be found in the block's code, the addition should be done in &amp;lt;tt&amp;gt;lib-custom.php&amp;lt;/tt&amp;gt; instead.&lt;br /&gt;
* Plugin developers need to define their tables in the plugin &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt; file (or some other suitable file belonging to the plugin, e.g. &amp;lt;tt&amp;gt;functions.inc&amp;lt;/tt&amp;gt;). You have the ability to use the &amp;lt;code&amp;gt;$_TABLES&amp;lt;/code&amp;gt; array or use your own plugin specific array to maintain the table definitions. In the latter case it's recommend that your arrays use a name such as &amp;lt;code&amp;gt;_XX_TABLES&amp;lt;/code&amp;gt;, where XX are two letters to describe your plugin. Once the plugin is installed and enabled, the tables defined for the plugin are automatically known as globals.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== lib-plugins.php ==&lt;br /&gt;
&lt;br /&gt;
This library contains all the code used to interface your plugin or block to Geeklog. You will not call any code from here directly. The functions in this file are called by the Geeklog main programs as they are used to call all plugins and are used to resolve the plugin name and check if your plugin has a particular function. You will usually only have to look at this file to understand some nuance of the implementation. See the [[Functions.inc - Listing of the Plugin Functions|documentation for &amp;lt;tt&amp;gt;functions.inc&amp;lt;/tt&amp;gt;]] and the original [[Plugin Development|plugin documentation]] for further help. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How your Plugin or Block Interacts with Geeklog ==&lt;br /&gt;
&lt;br /&gt;
The program &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; is the key to all interaction with Geeklog. It includes all of the Geeklog code libraries.&lt;br /&gt;
&lt;br /&gt;
* At the top of &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; is an include of &amp;lt;tt&amp;gt;lib-custom.php&amp;lt;/tt&amp;gt;. This is where you place all your block functions. They are then included when the site &amp;lt;tt&amp;gt;index.php&amp;lt;/tt&amp;gt; is called. &lt;br /&gt;
* At the very end of &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; is a check for all enabled plugins. A plugin is registered with Geeklog when it has a record in the plugins table and the field &amp;lt;tt&amp;gt;pi_enabled&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;1&amp;lt;/tt&amp;gt;. For all registered and enabled plugins, the code in &amp;lt;tt&amp;gt;lib-common.php&amp;lt;/tt&amp;gt; will include the &amp;lt;tt&amp;gt;functions.inc&amp;lt;/tt&amp;gt; file for each plugin. This is why the naming convention and location for each plugin file is strictly defined. All code libraries or configuration files your plugin needs should be included in your &amp;lt;tt&amp;gt;functions.inc&amp;lt;/tt&amp;gt;. Since the plugin's &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt; (if it exists) is now also included this way - via the include in &amp;lt;tt&amp;gt;functions.inc&amp;lt;/tt&amp;gt; - the variables in your plugin &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt; become global and can be referenced in your plugin functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Global Variables ==&lt;br /&gt;
&lt;br /&gt;
There are a few commonly used globals within Geeklog that you will want to use and reference. The following table outlines the more frequently used ones and its recommended that these be used instead of hard coding paths and table names in your links or project code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;border-collapse: collapse&amp;quot; bordercolor=&amp;quot;#111111&amp;quot; width=&amp;quot;75%&amp;quot; id=&amp;quot;AutoNumber2&amp;quot; height=&amp;quot;72&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; bgcolor=&amp;quot;#000000&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#FFFFFF&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;Variable&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; bgcolor=&amp;quot;#000000&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#FFFFFF&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp; Description&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; height=&amp;quot;17&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;$_CONF['path_html']&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;17&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Fully qualified path to your site's public_html path&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;$_CONF['site_url']&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Full URL to your site's public_html directory&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;$_CONF['site_admin_url']&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Full URL to your site's admin directory&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;$_USER['uid']&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Current user ID. A uid of 1 is an anonymous user.&amp;lt;br/&amp;gt;Note: This variable may not be set, which also should be handled as an anonymous user. Use the function &amp;lt;code&amp;gt;COM_isAnonUser()&amp;lt;/code&amp;gt;.&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;27%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;$_TABLES['tablename']&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;An array of Geeklog tables with the site prefix defined.&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Commonly used Geeklog functions ==&lt;br /&gt;
&lt;br /&gt;
The following is a list of commonly used Geeklog functions that as developers we use and recommend you become more familiar with and use in your development projects. You will find example usage of these functions throughout the Geeklog code. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;table border=&amp;quot;1&amp;quot; style=&amp;quot;border-collapse: collapse&amp;quot; bordercolor=&amp;quot;#111111&amp;quot; width=&amp;quot;100%&amp;quot; id=&amp;quot;AutoNumber1&amp;quot; height=&amp;quot;197&amp;quot; cellpadding=&amp;quot;3&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; bgcolor=&amp;quot;#000000&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#FFFFFF&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;Function Name&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; bgcolor=&amp;quot;#000000&amp;quot; height=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font color=&amp;quot;#FFFFFF&amp;quot; size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp; Description&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_siteHeader&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Display the main site header and optionally if 'none' is passed &amp;lt;b&amp;gt;do not &amp;lt;/b&amp;gt;display the left blocks&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_siteFooter&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Display the main site footer and optionally if 'true' is passed display the right blocks&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;32&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_startBlock&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;32&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Formats the block title using the selected theme - pass the title, helpfile if any and optional block theme to apply if you do not want to use default&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_endBlock&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Formats the block footer using the selected theme or the optional block theme if you do not want to use default&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;12&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_errorLog&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;12&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Use to format an error message or use for debugging - view output in &amp;amp;lt;geeklog_dir&amp;amp;gt;/logs/error.log&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;DB_query&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;14&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Execute a formatted SQL query and return the record set to an array of records (which is also an array)&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;DB_fetchArray&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Retrieve a record as an array from the returned record set - which DB_query returned.&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;DB_numRows&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Returns the number of records retrieved by the DB_query result&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;DB_getItem&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;16&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Retrieve one record as an array.&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_checkHTML&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Use to strip out $, &amp;amp;lt;, &amp;amp;gt; , [code] and replace with the HTML codes&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;COM_checkWords&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Use to check passed text for any HTML tags that are not allowed as per the site config.php setting&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;SEC_inGroup&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Used to check if user has passed group rights.&amp;lt;br/&amp;gt;Example: SEC_inGroup('Root') - returns true if user is a member of the &amp;quot;Root&amp;quot; group&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;13%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;&amp;amp;nbsp;SEC_hasRights&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td width=&amp;quot;73%&amp;quot; height=&amp;quot;15&amp;quot;&amp;gt;&amp;lt;font size=&amp;quot;2&amp;quot;&amp;gt;Used to check if user has access right (feature).&amp;lt;br/&amp;gt;Example: SEC_hasRights('myplugin.edit')&amp;lt;/font&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugin Developers Handbook]] [[Category:Plugin Development]]&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5579</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5579"/>
				<updated>2009-08-14T23:27:45Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /*  Working with databases */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
== '''Running tests''' ==&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Viewing and deleting logs''' ==&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
== '''Structure''' ==&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
           -css&lt;br /&gt;
           -development-bundle&lt;br /&gt;
           -images&lt;br /&gt;
           -js&lt;br /&gt;
        -jobs (Scripts which can be pointed at by GUI and cronjobs to interact with test framework)&lt;br /&gt;
&lt;br /&gt;
== ''' Working with databases''' ==&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
&lt;br /&gt;
3. Create an object, e.g: &lt;br /&gt;
 $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: &lt;br /&gt;
 $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). &lt;br /&gt;
If you don't specify a database, it will load default.xml.&lt;br /&gt;
&lt;br /&gt;
== '''Adding tests''' ==&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
== '''Adding jobs''' ==&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system through what the test framework calls 'jobs'. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5578</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5578"/>
				<updated>2009-08-14T23:26:54Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
== '''Running tests''' ==&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Viewing and deleting logs''' ==&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
== '''Structure''' ==&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
           -css&lt;br /&gt;
           -development-bundle&lt;br /&gt;
           -images&lt;br /&gt;
           -js&lt;br /&gt;
        -jobs (Scripts which can be pointed at by GUI and cronjobs to interact with test framework)&lt;br /&gt;
&lt;br /&gt;
== ''' Working with databases''' ==&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
== '''Adding tests''' ==&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
== '''Adding jobs''' ==&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system through what the test framework calls 'jobs'. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5577</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5577"/>
				<updated>2009-08-14T23:21:32Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
== '''Running tests''' ==&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Viewing and deleting logs''' ==&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
== '''Structure''' ==&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
           -css&lt;br /&gt;
           -development-bundle&lt;br /&gt;
           -images&lt;br /&gt;
           -js&lt;br /&gt;
        -jobs (Scripts which can be pointed at by GUI and cronjobs to interact with test framework)&lt;br /&gt;
&lt;br /&gt;
== ''' Working with databases''' ==&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
== '''3. Adding tests''' ==&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
== '''4. Adding jobs''' ==&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5576</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5576"/>
				<updated>2009-08-14T23:17:02Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* Advanced details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
           -css&lt;br /&gt;
           -development-bundle&lt;br /&gt;
           -images&lt;br /&gt;
           -js&lt;br /&gt;
        -jobs (Scripts which can be pointed at by GUI and cronjobs to interact with test framework)&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5575</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5575"/>
				<updated>2009-08-14T22:27:01Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* Advanced details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
        -css&lt;br /&gt;
        -development-bundle&lt;br /&gt;
        -images&lt;br /&gt;
        -jobs (Scripts user by GUI and cronjobs, etc. can be pointed at to interact with test framework)&lt;br /&gt;
        -js&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5574</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5574"/>
				<updated>2009-08-14T22:25:23Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
    -css&lt;br /&gt;
    -development-bundle&lt;br /&gt;
    -images&lt;br /&gt;
    -jobs (Scripts user by GUI and cronjobs, etc. can be pointed at to interact with test framework)&lt;br /&gt;
    -js&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.  &lt;br /&gt;
  &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5573</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5573"/>
				<updated>2009-08-14T22:24:31Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
    -css&lt;br /&gt;
    -development-bundle&lt;br /&gt;
    -images&lt;br /&gt;
    -jobs (Scripts user by GUI and cronjobs, etc. can be pointed at to interact with test framework)&lt;br /&gt;
    -js&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
 require_once 'PHPUnit/Framework.php';&lt;br /&gt;
 require_once 'tst.class.php';        &lt;br /&gt;
These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
 require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
If you are using the XML database, add this line:&lt;br /&gt;
 require_once Tst::$tests.'files/classes/xmldb.class.php';                &lt;br /&gt;
Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.    &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework configuration file and tests class:&lt;br /&gt;
 require_once 'tst.class.php';&lt;br /&gt;
 require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
 $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5572</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5572"/>
				<updated>2009-08-14T22:20:56Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
Here is the file structure of the test suite:    &lt;br /&gt;
&lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
    -css&lt;br /&gt;
    -development-bundle&lt;br /&gt;
    -images&lt;br /&gt;
    -jobs (Scripts user by GUI and cronjobs, etc. can be pointed at to interact with test framework)&lt;br /&gt;
    -js&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
You can use xmldb.class.php in three steps.&lt;br /&gt;
1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2) Add these lines at the beginning of your file:&lt;br /&gt;
        require_once 'PHPUnit/Framework.php';&lt;br /&gt;
        require_once 'tst.class.php';&lt;br /&gt;
        &lt;br /&gt;
    These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
    require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
        &lt;br /&gt;
    If you are using the XML database, add this line:&lt;br /&gt;
        require_once Tst::$tests.'files/classes/xmldb.class.php';&lt;br /&gt;
                &lt;br /&gt;
    Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
    With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.    &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework config file and tests class:&lt;br /&gt;
    require_once 'tst.class.php';&lt;br /&gt;
    require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
    $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5571</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5571"/>
				<updated>2009-08-14T22:18:25Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* How do I add to it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced details ==&lt;br /&gt;
&lt;br /&gt;
'''1. Structure'''&lt;br /&gt;
&lt;br /&gt;
    Here is the file structure of the test suite:    &lt;br /&gt;
    -testpackage (files which should be outside webroot)&lt;br /&gt;
        -files&lt;br /&gt;
            -classes (Geeklog test framework classes)&lt;br /&gt;
            -databases (XML 'dummy' databases for testing use)&lt;br /&gt;
            -dummy (Dummy file structure, this makes the test framework run on Geeklog files without Geeklog needing to be installed)&lt;br /&gt;
        -logs (Logs of tests run)&lt;br /&gt;
        -suite (This is where all the test classes are actually stored)&lt;br /&gt;
            -geeklog&lt;br /&gt;
                -public_html&lt;br /&gt;
                -system&lt;br /&gt;
                    -classes&lt;br /&gt;
    -tests (This should be in your webroot)&lt;br /&gt;
        -gui (Files for GUI)&lt;br /&gt;
    -css&lt;br /&gt;
    -development-bundle&lt;br /&gt;
    -images&lt;br /&gt;
    -jobs (Scripts user by GUI and cronjobs, etc. can be pointed at to interact with test             framework)&lt;br /&gt;
    -js&lt;br /&gt;
&lt;br /&gt;
'''2. Working with databases'''&lt;br /&gt;
   &lt;br /&gt;
    This test package is designed to work with or without a Geeklog install. It does this by using the configuration paths you specified in the installation, and by using a XML version of Geeklog's SQL database. To write tests for a file requiring database calls, first ensure that default.xml exists (in testpackage/files/databases). This is the XML version of Geeklog's database, as appears after a fresh install. The class that handles the operations (done with simpleXML and xPath) on the database is xmldb.class.php, under testpackage/files/databases. &lt;br /&gt;
    &lt;br /&gt;
    You can use xmldb.class.php in three steps.&lt;br /&gt;
    1. Require tst.class.php, e.g: require_once 'tst.class.php'. You should be doing this anyway.&lt;br /&gt;
    2. Require the file, e.g: require_once Tst::$tests.'/files/databases/xmldb.class.php'. &lt;br /&gt;
    3. Create an object, e.g: $this-&amp;gt;xml = new Xmldb;&lt;br /&gt;
    4. Call the function you want, providing the database you want to load as the parameter, e.g: $_CONF = $this-&amp;gt;xml-&amp;gt;get_CONF('database'). If you don't specify a database, it will load default.xml.&lt;br /&gt;
    &lt;br /&gt;
'''3. Adding tests'''&lt;br /&gt;
&lt;br /&gt;
    This will integrate new PHPUnit tests with the Geeklog test framework, (for example, if you wanted to write your own tests for Geeklog files and add them to the suite).&lt;br /&gt;
1) Save your test to the correct folder. Under testpackage/suite is a folder named 'geeklog'. This contains tests for Geeklog files in a folder structure mirroring that of a typical Geeklog installation. For example, lib-common.php is located under geeklog/public_html, so you would save its test under testpackage/files/suite/geeklog/public_html.  Name it as [filename]Test.php (a test for lib-common would be lib-commonTest.php).&lt;br /&gt;
    &lt;br /&gt;
2)     Add these lines at the beginning of your file:&lt;br /&gt;
        require_once 'PHPUnit/Framework.php';&lt;br /&gt;
        require_once 'tst.class.php';&lt;br /&gt;
        &lt;br /&gt;
    These will implement the PHPUnit framework and Geeklog's framework config file.&lt;br /&gt;
&lt;br /&gt;
3) Now, require the class you are writing a test for, e.g:&lt;br /&gt;
    require_once Tst::$root.'system/lib-mbyte.php';&lt;br /&gt;
        &lt;br /&gt;
    If you are using the XML database, add this line:&lt;br /&gt;
        require_once Tst::$tests.'files/classes/xmldb.class.php';&lt;br /&gt;
                &lt;br /&gt;
    Your test should be ready to run!&lt;br /&gt;
&lt;br /&gt;
'''4. Adding jobs'''&lt;br /&gt;
&lt;br /&gt;
    With a few lines of code, you can interact with the Geeklog test framework's test running and logging system. These scripts are typically stored under tests/gui/jobs. You can browse through the existing scripts and tests.class.php to see how they work and are implemented. Let's take 'tests/gui/jobs/runAll.php' as an example.    &lt;br /&gt;
1) These two lines at the beginning of the script include Geeklog's test framework config file and tests class:&lt;br /&gt;
    require_once 'tst.class.php';&lt;br /&gt;
    require_once Tst::$tests.'files/classes/tests.class.php';&lt;br /&gt;
2) This creates an instance of tests.class.php:&lt;br /&gt;
    $tests = new Tests;&lt;br /&gt;
3) Now we can perform any action on the test framework already scripted in tests.class.php, if you need to do something not already provided in this class, add it if you think it may be useful to other people. If it's something that will only be used once, just put it in the script. In this example, we tell $tests-&amp;gt;runTests() to run tests on all files under 'suite', create a JSON log for the output, and discard the console output. A cronjob could be pointed at this and run it on a specified schedule.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5570</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5570"/>
				<updated>2009-08-14T22:16:27Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I add to it? ==&lt;br /&gt;
&lt;br /&gt;
The Geeklog test suite is essentially a shell for the PHPUnit test suite that organizes tests, enables logging, and uses a GUI.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5569</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5569"/>
				<updated>2009-08-14T21:54:29Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has its own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see the logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5568</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5568"/>
				<updated>2009-08-14T21:53:57Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see it's logging features being used at the [http://project.geeklog.net/ttt/tests/index_js.php Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5567</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5567"/>
				<updated>2009-08-14T21:53:08Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. You can see it's logging features being used at the [[http://project.geeklog.net/ttt/tests/index_js.php] Geeklog project site].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5566</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5566"/>
				<updated>2009-08-14T21:47:35Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing and deleting logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5565</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5565"/>
				<updated>2009-08-14T21:44:47Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* How do I use it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the console. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5564</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5564"/>
				<updated>2009-08-14T21:44:18Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* How do I use it? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the command line. &lt;br /&gt;
&lt;br /&gt;
'''Note: the GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5563</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5563"/>
				<updated>2009-08-14T21:43:30Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the command line. &lt;br /&gt;
&lt;br /&gt;
'''Note: The GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5562</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5562"/>
				<updated>2009-08-14T21:43:11Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What can it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
'''1. Running tests'''&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the command line. &lt;br /&gt;
&lt;br /&gt;
'''Note: The GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
'''2. Viewing logs'''&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5561</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5561"/>
				<updated>2009-08-14T21:41:14Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: /* 2. Viewing logs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What does it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
=='''1. Running tests'''==&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the command line. &lt;br /&gt;
&lt;br /&gt;
'''Note: The GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
=='''2. Viewing logs'''==&lt;br /&gt;
&lt;br /&gt;
If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5560</id>
		<title>Test Suite</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=Test_Suite&amp;diff=5560"/>
				<updated>2009-08-14T21:40:48Z</updated>
		
		<summary type="html">&lt;p&gt;Sean c: New page: Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit].    == What does it do? ==  Using the test suite, you can ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Geeklog has it's own [http://en.wikipedia.org/wiki/Unit_testing) unit testing] suite, powered by [http://www.phpunit.de/ PHPUnit]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== What does it do? ==&lt;br /&gt;
&lt;br /&gt;
Using the test suite, you can run tests on the existing code, ensuring that the code continues to do exactly what it is supposed to do in a variety of scenarios. The suite uses a GUI, which displays existing tests that can be run, returns PHPUnit's console output, and stores the results to log files that can be viewed at any time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How do I use it? ==&lt;br /&gt;
&lt;br /&gt;
=='''1. Running tests'''==&lt;br /&gt;
&lt;br /&gt;
You have two ways you can run your tests. One is by using a simple GUI included with the test package, and the second is by using the command line. &lt;br /&gt;
&lt;br /&gt;
'''Note: The GUI only fully supports Firefox &amp;gt;3 with javascript enabled.'''&lt;br /&gt;
&lt;br /&gt;
To use the GUI, navigate with your browser to the tests folder in your Geeklog site (e.g: http://localhost/public_html/tests). You should be at a page called 'index_js.php'. Under the left panel titled 'Run Tests' is a tree structure of all available tests for the Geeklog test framework. Select any number of tests you like (if you choose a folder, all the tests inside will be included), choose whether to have the console output returned, logs created, and logs immediately shown, and click 'Run Tests'. It may take a few minutes, so be patient.&lt;br /&gt;
&lt;br /&gt;
To use your tests using your console, open the console and navigate to the public_html/tests folder. From here, you can type 'phpunit (path/to/testclass/testname)', and the test you specify will be run, with the results displayed in the console. If you specify a folder, all tests inside will be run. Running tests this way will not create logs or interact with the suite.&lt;br /&gt;
&lt;br /&gt;
'''Note: this will only work if you are in the tests root folder (with tst.class.php). This is because of the path structure.''' &lt;br /&gt;
&lt;br /&gt;
You can find more information on running tests in the [http://www.phpunit.de/manual/3.3/en/textui.html PHPUnit manual].&lt;br /&gt;
&lt;br /&gt;
=='''2. Viewing logs'''==&lt;br /&gt;
    If you are running tests with the GUI, the event will be logged in testpackage/logs/masterlog.txt, and JSON logs will be created in the same folder with information for the event. You can view these logs using the 'View logs' panel in the GUI - select the logs you want to view and press 'View'. Alternatively, you can delete old logs by selecting the logs and - you got it - pressing 'Delete'.&lt;/div&gt;</summary>
		<author><name>Sean c</name></author>	</entry>

	</feed>