<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h1&gt;Introduction to Loader Classes&lt;/h1&gt;
&lt;p&gt;Secretly, behind the scenes, when you run snaptest.php a file loader gets used. Its job is to scan the file you&amp;#8217;ve provided and add a list of runnable tests to the master stack. Most of the time, this is an automated process. However, in some deployments, it might become necessary to change the way loading works. Having a modular loader system makes it possible to pull in tests from &lt;span class=&quot;caps&quot;&gt;XML&lt;/span&gt;, a database, or even over a socket (in theory).&lt;/p&gt;
&lt;h1&gt;The Loader Interface (via Abstract)&lt;/h1&gt;
&lt;pre&gt;&lt;code&gt;
abstract public function add($item);

protected final function addTest($test) {...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The two major things to do when building a loader is to define the &lt;code&gt;add()&lt;/code&gt; statement, which will take in a single $item. Normally this would be a file matching the &lt;code&gt;--match&lt;/code&gt; regular expression. When inside of &lt;code&gt;add()&lt;/code&gt;, &lt;code&gt;$this-&amp;gt;addTest($test)&lt;/code&gt; should be called for every test encountered.&lt;/p&gt;
&lt;p&gt;You can then call &lt;code&gt;$snap-&amp;gt;addInput($input_handler, $item)&lt;/code&gt;, which will use your loader class you just created.&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-26T23:12:05-08:00</created-at>
  <id type="integer">270423</id>
  <permalink>loader-classes</permalink>
  <repository-id type="integer">1880</repository-id>
  <title>Loader Classes</title>
  <updated-at type="datetime">2009-07-19T16:22:08-07:00</updated-at>
  <user-id type="integer">1795</user-id>
</wiki>
