Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Massive overhaul of all documentation.

All documentation now works reasonibly well with Doxygen.
  • Loading branch information...
commit 01d5816fdaf33384944201638ed0ceaa33b9a07b 1 parent 9ce617f
@technosophos technosophos authored
Showing with 158 additions and 89 deletions.
  1. +5 −30 build.xml
  2. +1 −1  config.doxy
  3. +1 −1  examples/database_import.php
  4. +1 −1  examples/dbpedia.php
  5. +1 −1  examples/dirty_html.php
  6. +1 −1  examples/doc.php
  7. +1 −1  examples/docx.php
  8. +1 −1  examples/fetch_rss.php
  9. +0 −1  examples/html.php
  10. +1 −1  examples/matching_text_content.php
  11. +1 −1  examples/musicbrainz.php
  12. +1 −1  examples/odt.php
  13. +1 −1  examples/parse_php.php
  14. +1 −1  examples/rss.php
  15. +1 −1  examples/simple_example.php
  16. +1 −1  examples/sparql.php
  17. +1 −1  examples/svg.php
  18. +1 −1  examples/techniques.php
  19. +1 −1  examples/xml.php
  20. +5 −3 src/QueryPath/CssEventHandler.php
  21. +17 −3 src/QueryPath/CssParser.php
  22. +44 −10 src/QueryPath/QueryPath.php
  23. +1 −1  test/Tests/QueryPath/BottomUpCssEventHandlerTests.php
  24. +13 −3 test/Tests/QueryPath/CssEventTest.php
  25. +1 −2  test/Tests/QueryPath/Extensions/QPDBTest.php
  26. +3 −1 test/Tests/QueryPath/Extensions/QPListTest.php
  27. +12 −5 test/Tests/QueryPath/Extensions/QPTPLTest.php
  28. +3 −2 test/Tests/QueryPath/Extensions/QPXMLTest.php
  29. +3 −2 test/Tests/QueryPath/Extensions/QPXSLTest.php
  30. +4 −2 test/Tests/QueryPath/QueryPathEntitiesTest.php
  31. +16 −2 test/Tests/QueryPath/QueryPathExtensionTest.php
  32. +3 −1 test/Tests/QueryPath/QueryPathOptionsTest.php
  33. +7 −1 test/Tests/QueryPath/QueryPathTest.php
  34. +4 −3 test/test.php
View
35 build.xml
@@ -142,7 +142,7 @@ To print this message, do:
<stripphpcomments/>
<!-- Removed per issue #20 -->
<!-- stripwhitespace/ -->
- <replacetokens begintoken="@" endtoken="@">
+ <replacetokens begintoken="-" endtoken="%">
<token key="UNSTABLE" value="${version}"/>
</replacetokens>
</filterchain>
@@ -184,7 +184,7 @@ To print this message, do:
<!-- Copy source code, doing token replacement on version. -->
<copy todir="${releasedir}/src">
<filterchain>
- <replacetokens begintoken="@" endtoken="@">
+ <replacetokens begintoken="-" endtoken="%">
<token key="UNSTABLE" value="${version}"/>
</replacetokens>
</filterchain>
@@ -235,37 +235,12 @@ To print this message, do:
<target name="doc" depends="lint,setup" description="Generate API docs.">
<delete dir="${docsdir}"/>
<doxygen config="./config.doxy"/>
- <!--
- <phpdoc title="QueryPath ${version}"
- sourcecode="yes"
- destdir="${docsdir}"
- output="${phpdoc.style}"
- defaultcategoryname="QueryPath"
- defaultpackagename="QueryPath"
- examplesdir="examples"
- quiet="true"
- >
- <fileset refid="sourcecode"/>
- <fileset refid="tutorials"/>
- <fileset refid="examplecode"/>
- <projdocfileset dir=".">
- <include name="README.md"/>
- <include name="README"/>
- <include name="INSTALL"/>
- <include name="COPYING-LGPL.txt"/>
- <include name="COPYING-MIT.txt"/>
- <include name="LGPL-2.1.txt"/>
- <include name="RELEASE-*"/>
- <include name="API-*"/>
- </projdocfileset>
- </phpdoc>
- -->
<!-- Need to replace version information in generated documentation -->
<reflexive>
<fileset refid="docs"/>
<filterchain>
- <replacetokens begintoken="@" endtoken="@">
+ <replacetokens begintoken="-" endtoken="%">
<token key="UNSTABLE" value="${version}"/>
</replacetokens>
</filterchain>
@@ -393,7 +368,7 @@ To print this message, do:
<filterchain>
<stripphpcomments/>
<stripwhitespace/>
- <replacetokens begintoken="@" endtoken="@">
+ <replacetokens begintoken="-" endtoken="%">
<token key="UNSTABLE" value="${version}"/>
<token key="PHAR_FILENAME" value="QueryPath.phar"/>
</replacetokens>
@@ -462,7 +437,7 @@ To print this message, do:
<filterchain>
<!-- stripphpcomments/ -->
<!-- stripwhitespace/ -->
- <replacetokens begintoken="@" endtoken="@">
+ <replacetokens begintoken="-" endtoken="%">
<token key="UNSTABLE" value="${version}"/>
</replacetokens>
</filterchain>
View
2  config.doxy
@@ -38,7 +38,7 @@ PROJECT_NUMBER = 2.1.0beta3
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
-OUTPUT_DIRECTORY = docs
+OUTPUT_DIRECTORY = doc
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
View
2  examples/database_import.php
@@ -2,7 +2,7 @@
/**
* Use QueryPath's database extension to import XML data into a database.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/dbpedia.php
@@ -16,7 +16,7 @@
* Data stored there for a particular Wikipedia entry (any Wikipedia
* wiki name should work here).
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.w3.org/DesignIssues/LinkedData.html
View
2  examples/dirty_html.php
@@ -2,7 +2,7 @@
/**
* Urban Dictionary Random Word Generator
*
- * @package Examples
+ *
* @author Emily Brand
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.urbandictionary.com/
View
2  examples/doc.php
@@ -2,7 +2,7 @@
/**
* Compare jQuery documentation to QueryPath documentation
*
- * @package Examples
+ *
* @author Emily Brand
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://api.jquery.com/api/
View
2  examples/docx.php
@@ -4,7 +4,7 @@
*
* For namespaces use | instead of :
*
- * @package Examples
+ *
* @author Emily Brand
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.urbandictionary.com/
View
2  examples/fetch_rss.php
@@ -11,7 +11,7 @@
* parse it. From there, we make a list of hyperlinks, one for each item in
* the original feed.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
1  examples/html.php
@@ -12,7 +12,6 @@
* templates, injecting database information with {@link QPDB}, and merging
* data from one QueryPath to another.
*
- * @ingroup Examples
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/matching_text_content.php
@@ -12,7 +12,7 @@
* and exact match, so the method outline below is roughly the same as merely
* using `:contains(Release)`.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/musicbrainz.php
@@ -10,7 +10,7 @@
*
* TODO: Fix the output.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://musicbrainz.org
View
2  examples/odt.php
@@ -12,7 +12,7 @@
* The file used here was generated by OpenOffice 3.x. Other word processors are
* also capable of generating ODT files.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/parse_php.php
@@ -10,7 +10,7 @@
*
* This example illustrates how such a file can be parsed and manipulated.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/rss.php
@@ -13,7 +13,7 @@
* methods of looping. An even more advanced method would be to use the
* {@link QPTPL} library.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/simple_example.php
@@ -13,7 +13,7 @@
* This file is fully explained in the official QueryPath tutorial, located
* at {@link https://fedorahosted.org/querypath/wiki/QueryPathTutorial}
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see qp()
View
2  examples/sparql.php
@@ -10,7 +10,7 @@
* QueryPath. POST queries are supported, too. Use a stream context
* to create those.
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
* @see http://www.w3.org/2009/sparql/wiki/Main_Page
View
2  examples/svg.php
@@ -11,7 +11,7 @@
* at {@link http://querypath.org/svg.php}. (That URL actually runs the script displayed
* here.)
*
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
2  examples/techniques.php
@@ -14,7 +14,7 @@
* altered during a loop.
*
* @see QueryPath
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL (The GNU Lesser GPL) or an MIT-like license.
*/
View
2  examples/xml.php
@@ -14,7 +14,7 @@
* </code>
* (A space was inserted above to prevent the documentation renderer from
* misinterpreting it.)
- * @package Examples
+ *
* @author M Butcher <matt@aleph-null.tv>
* @license LGPL The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
View
8 src/QueryPath/CssEventHandler.php
@@ -32,7 +32,7 @@
* is no calculation done.
*
* For detailed examples of how the code works and what selectors are supported,
- * see the {@see CssEventTests.php} file, which contains the unit tests used for
+ * see the CssEventTests file, which contains the unit tests used for
* testing this implementation.
*
* @author M Butcher <matt@aleph-null.tv>
@@ -53,13 +53,13 @@
* match and the previously matched elements.
*
* To use this handler:
- * <code>
+ * @code
* $filter = '#id'; // Some CSS selector
* $handler = new QueryPathCssParser(DOMNode $dom);
* $parser = new CssParser();
* $parser->parse($filter, $handler);
* $matches = $handler->getMatches();
- * </code>
+ * @endcode
*
* $matches will be an array of zero or more DOMElement objects.
*
@@ -1419,5 +1419,7 @@ public function attachNodeList(DOMNodeList $nodeList, SplObjectStorage $splos) {
*
* This is thrown in cases where some feature is expected, but the current
* implementation does not support that feature.
+ *
+ * @ingroup querypath_css
*/
class NotImplementedException extends Exception {}
View
20 src/QueryPath/CssParser.php
@@ -13,9 +13,13 @@
* @license http://opensource.org/licenses/lgpl-2.1.php The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
-/** addtogroup querypath_css CSS Parsing
+/** @addtogroup querypath_css CSS Parsing
* QueryPath includes a CSS 3 Selector parser.
*
+ *
+ * Typically the parser is not accessed directly. Most developers will use it indirectly from
+ * qp(), htmlqp(), or one of the methods on a QueryPath object.
+ *
* This parser is modular and is not tied to QueryPath, so you can use it in your
* own (non-QueryPath) projects if you wish. To dive in, start with CssEventHandler, the
* event interface that works like a SAX API for CSS selectors. If you want to check out
@@ -34,6 +38,8 @@
*
* This library is inspired by the SAX2 API for parsing XML. Each component of a
* selector fires an event, passing the necessary data on to the event handler.
+ *
+ * @ingroup querypath_css
*/
interface CssEventHandler {
/** The is-exactly (=) operator. */
@@ -113,13 +119,13 @@ public function attribute($name, $value = NULL, $operation = CssEventHandler::is
* Example: [ns|name~=attr]
* @param string $name
* The attribute name.
+ * @param string $ns
+ * The namespace identifier (not the URI).
* @param string $value
* The value of the attribute, if given.
* @param int $operation
* The operation to be used for matching. See {@link CssEventHandler}
* constants for a list of supported operations.
- * @param string $namespace
- * The namespace identifier (not the URI).
*/
public function attributeNS($name, $ns, $value = NULL, $operation = CssEventHandler::isExactly);
/**
@@ -170,6 +176,8 @@ public function anyDescendant(); // ' ' (space) operator.
* Tokens for CSS.
* This class defines the recognized tokens for the parser, and also
* provides utility functions for error reporting.
+ *
+ * @ingroup querypath_css
*/
final class CssToken {
const char = 0;
@@ -231,6 +239,8 @@ static function name($const_int) {
* This class provides an event-based parser for CSS selectors. It can be
* used, for example, as a basis for writing a DOM query engine based on
* CSS.
+ *
+ * @ingroup querypath_css
*/
class CssParser {
protected $scanner = NULL;
@@ -787,6 +797,8 @@ private function throwError($expected, $got) {
* Scanner for CSS selector parsing.
*
* This provides a simple scanner for traversing an input stream.
+ *
+ * @ingroup querypath_css
*/
final class CssScanner {
var $is = NULL;
@@ -1090,5 +1102,7 @@ function isEmpty() {
/**
* Exception indicating an error in CSS parsing.
+ *
+ * @ingroup querypath_css
*/
class CSSParseException extends EXCEPTION {}
View
54 src/QueryPath/QueryPath.php
@@ -61,11 +61,23 @@
*
*/
-/** @addtogroup querypath_core QueryPath Core
+/** @addtogroup querypath_core Core API
* Core classes and functions for QueryPath.
+ *
+ * These are the classes, objects, and functions that developers who use QueryPath
+ * are likely to use. The qp() and htmlqp() functions are the best place to start,
+ * while most of the frequently used methods are part of the QueryPath object.
*/
-/** @namespace QueryPath
+/** @addtogroup querypath_util Utilities
+ * Utility classes for QueryPath.
+ *
+ * These classes add important, but less-often used features to QueryPath. Some of
+ * these are used transparently (QueryPathIterator). Others you can use directly in your
+ * code (QueryPathEntities).
+ */
+
+/* * @namespace QueryPath
* The core classes that compose QueryPath.
*
* The QueryPath classes contain the brunt of the QueryPath code. If you are
@@ -267,7 +279,7 @@ class QueryPath implements IteratorAggregate {
*
* @since 2.0
*/
- const VERSION = '@UNSTABLE@';
+ const VERSION = '-UNSTABLE%';
/**
* This is a stub HTML 4.01 document.
@@ -854,6 +866,8 @@ public function hasAttr($attrName) {
* If this is a string, it will be used as a CSS name. If it is an array,
* this will assume it is an array of name/value pairs of CSS rules. It will
* apply all rules to all elements in the set.
+ * @param string $value
+ * The value to set. This is only set if $name is a string.
* @return QueryPath
*/
public function css($name = NULL, $value = '') {
@@ -1069,7 +1083,7 @@ public function filter($selector) {
* The above would filter down the list to only an item whose ID is
* 'text'.
*
- * @param string $function
+ * @param string $fn
* Inline lambda function in a string.
* @return QueryPath
* @see filter()
@@ -1151,7 +1165,7 @@ public function filterPreg($regex) {
* If the callback function returns FALSE, the item will be removed from the
* set of matches. Otherwise the item will be considered a match and left alone.
*
- * @param $callback.
+ * @param callback $callback.
* A callback either as a string (function) or an array (object, method OR
* classname, method).
* @return QueryPath
@@ -1299,14 +1313,15 @@ public function map($callback) {
*
* @param integer $start
* Where in the list of matches to begin the slice.
- * @param integer $count
+ * @param integer $length
* The number of items to include in the slice. If nothing is specified, the
* all remaining matches (from $start onward) will be included in the sliced
* list.
* @return QueryPath
* @see array_slice()
*/
- public function slice($start, $end = 0) {
+ public function slice($start, $length = 0) {
+ $end = $length;
$found = new SplObjectStorage();
if ($start >= $this->size()) {
$this->setMatches($found);
@@ -1445,7 +1460,7 @@ public function append($data) {
* $destination is queried (using that selector) prior to the data being
* appended. The data is then appended to the found items.
*
- * @param QueryPath $destination
+ * @param QueryPath $dest
* A QueryPath object that will be appended to.
* @return QueryPath
* The original QueryPath, unaltered. Only the destination QueryPath will
@@ -1464,7 +1479,7 @@ public function appendTo(QueryPath $dest) {
*
* The markup will be inserted into each match in the set.
*
- * @param mixed $prependage
+ * @param mixed $data
* This can be either a string (the usual case), or a DOM Element.
* @return QueryPath
* @see append()
@@ -2541,9 +2556,11 @@ public function innerXML() {
* This has the effect of looping through all children, retrieving their text
* content, and then concatenating the text with a separator.
*
- * @param string $separator
+ * @param string $sep
* The string used to separate text items. The default is a comma followed by a
* space.
+ * @param boolean $filterEmpties
+ * If this is true, empty items will be ignored.
* @return string
* The text contents, concatenated together with the given separator between
* every pair of items.
@@ -4006,6 +4023,11 @@ public function getIterator() {
}
}
+/**
+ * Perform various tasks on HTML/XML entities.
+ *
+ * @ingroup querypath_util
+ */
class QueryPathEntities {
/**
@@ -4160,6 +4182,8 @@ public static function replaceEntity($entity) {
* This provides iterator support for QueryPath. You do not need to construct
* a QueryPathIterator. QueryPath does this when its {@link QueryPath::getIterator()}
* method is called.
+ *
+ * @ingroup querypath_util
*/
class QueryPathIterator extends IteratorIterator {
public $options = array();
@@ -4197,6 +4221,7 @@ public function current() {
*
* @see qp()
* @see QueryPathOptions::set()
+ * @ingroup querypath_util
*/
class QueryPathOptions {
@@ -4261,6 +4286,8 @@ static function has($key) {
/**
* Exception indicating that a problem has occured inside of a QueryPath object.
+ *
+ * @ingroup querypath_core
*/
class QueryPathException extends Exception {}
@@ -4269,6 +4296,8 @@ class QueryPathException extends Exception {}
*
* This will report parser warnings as well as parser errors. It should only be
* thrown, though, under error conditions.
+ *
+ * @ingroup querypath_core
*/
class QueryPathParseException extends QueryPathException {
const ERR_MSG_FORMAT = 'Parse error in %s on line %d column %d: %s (%d)';
@@ -4299,6 +4328,11 @@ public static function initializeFromError($code, $str, $file, $line, $cxt) {
}
}
+/**
+ * Indicates that an input/output exception has occurred.
+ *
+ * @ingroup querypath_core
+ */
class QueryPathIOException extends QueryPathParseException {
public static function initializeFromError($code, $str, $file, $line, $cxt) {
$class = __CLASS__;
View
2  test/Tests/QueryPath/BottomUpCssEventHandlerTests.php
@@ -1,7 +1,6 @@
<?php
/**
* Unstable testing code.
- * @package Tests
*/
require_once 'PHPUnit/Framework.php';
@@ -11,6 +10,7 @@
/**
* Tests for QueryPathCssEventHandler class.
+ * @ingroup querypath_tests
*/
class BottomUpCssEventHandlerTests extends QueryPathCssEventHandlerTests {
public $xml = '<?xml version="1.0" ?>
View
16 test/Tests/QueryPath/CssEventTest.php
@@ -1,12 +1,15 @@
<?php
-/**
- * @package Tests
+/** @file
+ * CSS Event handling tests
*/
require_once 'PHPUnit/Framework.php';
//require_once 'src/QueryPath/CssEventHandler.php';
require_once 'src/QueryPath/QueryPath.php';
+/**
+ * @ingroup querypath_tests
+ */
class CssTokenTest extends PHPUnit_Framework_TestCase {
public function testName() {
@@ -19,6 +22,7 @@ public function testName() {
/**
* Tests for QueryPathCssEventHandler class.
+ * @ingroup querypath_tests
*/
class QueryPathCssEventHandlerTests extends PHPUnit_Framework_TestCase {
@@ -1404,7 +1408,9 @@ public function testAnyDescendant() {
}
-
+/**
+ * @ingroup querypath_tests
+ */
class CssEventParserTests extends PHPUnit_Framework_TestCase {
private function getMockHandler($method) {
@@ -1782,6 +1788,8 @@ public function testAllCombo() {
/**
* Testing harness for the CssEventHandler.
+ *
+ * @ingroup querypath_tests
*/
class TestCssEventHandler implements CssEventHandler {
var $stack = NULL;
@@ -1865,6 +1873,8 @@ public function sibling(){
/**
* Simple utility object for use with the TestCssEventHandler.
+ *
+ * @ingroup querypath_tests
*/
class TestEvent {
const elementID = 0;
View
3  test/Tests/QueryPath/Extensions/QPDBTest.php
@@ -3,7 +3,6 @@
* Tests for the QueryPath library.
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
- * @package Tests
*/
require_once 'PHPUnit/Framework.php';
@@ -14,7 +13,7 @@
QPDB::baseDB('sqlite:./test/db/qpTest.db');
/**
- * @package Tests
+ * @ingroup querypath_tests
*/
class QPDBTest extends PHPUnit_Framework_TestCase {
private $dsn = 'sqlite:./test/db/qpTest.db';
View
4 test/Tests/QueryPath/Extensions/QPListTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -10,6 +9,9 @@
require_once 'src/QueryPath/QueryPath.php';
require_once 'src/QueryPath/Extension/QPList.php';
+/**
+ * @ingroup querypath_tests
+ */
class QPListTests extends PHPUnit_Framework_TestCase {
public function testAppendList() {
$list = array('one', 'two', 'three');
View
17 test/Tests/QueryPath/Extensions/QPTPLTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -9,7 +8,9 @@
require_once 'PHPUnit/Framework.php';
require_once 'src/QueryPath/QueryPath.php';
require_once 'src/QueryPath/Extension/QPTPL.php';
-
+/**
+ * @ingroup querypath_tests
+ */
class QPTPLTest extends PHPUnit_Framework_TestCase {
public function testIsAssoc() {
@@ -150,19 +151,25 @@ public function testTplTraversable() {
}
}
-
+/**
+ * @ingroup querypath_tests
+ */
class IntrospectMe {
public function getMyClass() {
return 'FOO';
}
}
-
+/**
+ * @ingroup querypath_tests
+ */
class FixtureOne {
public function getBaz() {
return '<str id="baz">This is a string</str>';
}
}
-
+/**
+ * @ingroup querypath_tests
+ */
class FixtureTwo {
private $db;
View
5 test/Tests/QueryPath/Extensions/QPXMLTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -9,7 +8,9 @@
require_once 'PHPUnit/Framework.php';
require_once 'src/QueryPath/QueryPath.php';
require_once 'src/QueryPath/Extension/QPXML.php';
-
+/**
+ * @ingroup querypath_tests
+ */
class QPXMLTests extends PHPUnit_Framework_TestCase {
protected $file = './test/advanced.xml';
View
5 test/Tests/QueryPath/Extensions/QPXSLTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -9,7 +8,9 @@
require_once 'PHPUnit/Framework.php';
require_once 'src/QueryPath/QueryPath.php';
require_once 'src/QueryPath/Extension/QPXSL.php';
-
+/**
+ * @ingroup querypath_tests
+ */
class QPXSLTests extends PHPUnit_Framework_TestCase {
protected $file = './test/advanced.xml';
View
6 test/Tests/QueryPath/QueryPathEntitiesTest.php
@@ -1,7 +1,6 @@
<?php
-/**
+/** @file
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -9,6 +8,9 @@
require_once 'PHPUnit/Framework.php';
require_once 'src/QueryPath/QueryPath.php';
+/**
+ * @ingroup querypath_tests
+ */
class QueryPathEntitiesTest extends PHPUnit_Framework_TestCase {
public function testReplaceEntity() {
$entity = 'amp';
View
18 test/Tests/QueryPath/QueryPathExtensionTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -17,6 +16,7 @@
/**
* Run all of the usual tests, plus some extras, with some extensions loaded.
+ * @ingroup querypath_tests
*/
class QueryPathExtensionTest extends QueryPathTest {
//class QueryPathExtensionTest extends PHPUnit_Framework_TestCase {
@@ -89,6 +89,11 @@ public function testCallFailure() {
}
// Create a stub extension:
+/**
+ * Create a stub extension
+ *
+ * @ingroup querypath_tests
+ */
class StubExtensionOne implements QueryPathExtension {
private $qp = NULL;
public function __construct(QueryPath $qp) {
@@ -100,6 +105,11 @@ public function stubToe() {
return $this->qp;
}
}
+/**
+ * Create a stub extension
+ *
+ * @ingroup querypath_tests
+ */
class StubExtensionTwo implements QueryPathExtension {
private $qp = NULL;
public function __construct(QueryPath $qp) {
@@ -109,7 +119,11 @@ public function stuble($arg1, $arg2) {
return $arg1 . $arg2;
}
}
-
+/**
+ * Create a stub extension
+ *
+ * @ingroup querypath_tests
+ */
class StubExtensionThree implements QueryPathExtension {
private $qp = NULL;
public function __construct(QueryPath $qp) {
View
4 test/Tests/QueryPath/QueryPathOptionsTest.php
@@ -1,7 +1,6 @@
<?php
/**
* Tests for the QueryPath library.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -9,6 +8,9 @@
require_once 'PHPUnit/Framework.php';
require_once 'src/QueryPath/QueryPath.php';
+/**
+ * @ingroup querypath_tests
+ */
class QueryPathOptionsTest extends PHPUnit_Framework_TestCase {
public function testQueryPathOptions() {
View
8 test/Tests/QueryPath/QueryPathTest.php
@@ -7,7 +7,7 @@
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
-/** @addgroup querypath_tests Tests
+/** @addtogroup querypath_tests Tests
* Unit tests and regression tests for QueryPath.
*/
@@ -1558,6 +1558,8 @@ public function testEncodeDataURL() {
*
* This uses a testing harness, XMLishMock, to test
* a protected method of QueryPath.
+ *
+ * @ingroup querypath_test
*/
class XMLishTest extends PHPUnit_Framework_TestCase {
public function testXMLishMock() {
@@ -1587,6 +1589,8 @@ public function testXMLishWithBrokenHTML() {
/**
* A testing class for XMLish tests.
+ *
+ * @ingroup querypath_tests
*/
class XMLishMock extends QueryPath {
public function exposedIsXMLish($str) {
@@ -1596,6 +1600,8 @@ public function exposedIsXMLish($str) {
/**
* A simple mock for testing qp()'s abstract factory.
+ *
+ * @ingroup querypath_tests
*/
class QueryPathExtended extends QueryPath {
public $foo = 'bar';
View
7 test/test.php
@@ -4,7 +4,6 @@
* Generic CLI parser tests.
*
* These are not unit tests. They are just plain parser tests.
- * @package Tests
* @author M Butcher <matt@aleph-null.tv>
* @license The GNU Lesser GPL (LGPL) or an MIT-like license.
*/
@@ -14,8 +13,9 @@
/**
* Testing harness for the CssEventHandler.
+ * @ingroup querypath_tests
*/
-class TestCssEventHandler implements CssEventHandler {
+class SimpleTestCssEventHandler implements CssEventHandler {
var $stack = NULL;
var $expect = array();
@@ -97,6 +97,7 @@ public function sibling(){
/**
* Simple utility object for use with the TestCssEventHandler.
+ * @ingroup querypath_tests
*/
class TestEvent {
const elementID = 0;
@@ -145,7 +146,7 @@ public function params() {
$str = 'tag.class #id :test (test)';
print "Now testing: $str\n";
-$c = new TestCssEventHandler();
+$c = new SimpleTestCssEventHandler();
$p = new CssParser($str, $c);
$p->parse();
Please sign in to comment.
Something went wrong with that request. Please try again.