Testing_DocTest
[ class tree: Testing_DocTest ] [ index: Testing_DocTest ] [ all elements ]

Class: Testing_DocTest

Source Location: /Testing_DocTest-0.6.0/Testing/DocTest.php

Class Overview


DocTest.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2008 David JEAN LOUIS

Methods


Inherited Variables

Inherited Methods


Class Details

[line 47]
DocTest.


[ Top ]


Method Detail

accept   [line 146]

void accept( mixed $instance)

Method to allow DocTest to accept a custom finder, reporter, parser or runner instance.

  1.  class MyRunner implements Testing_DocTest_RunnerInterface {
  2.      function run(Testing_DocTest_TestCase $tb{
  3.          // do something here...
  4.      }
  5.  }
  6.  
  7.  try {
  8.      $goodRunner = new MyRunner();
  9.      $badRunner  = new stdclass();
  10.      $doctest    = new Testing_DocTest();
  11.      $doctest->accept($goodRunner);
  12.      echo "Ok !\n";
  13.      $doctest->accept($badRunner);
  14.  catch (Testing_DocTest_Exception $exc{
  15.      echo "Error !\n";
  16.  }
  17.  // expects:
  18.  // Ok !
  19.  // Error !

  • Throws: Testing_DocTest_Exception if wrong argument passed
  • Access: public

Parameters:

mixed   $instance     an instance implementing the finder, reporter, parser or runner interface.

[ Top ]

__construct (Constructor)   [line 93]

void __construct( [ $options = array()])

Constructor.

The $options array can have the following elements

  • quiet: tells the reporter to turn on quiet mode, only errors will be printed out (the default value is false);
  • no_colors: tells the reporter to not use colors when outputting results (the default value is false);
  • logfile: tells the reporter to write the results in a logfile instead of STDOUT;

  • Access: public

Parameters:

array   $options     an optional array of options

[ Top ]

run   [line 177]

void run( $pathes)

Run the tests contained in the given pathes.
  • Access: public

Parameters:

array   $pathes     an array of files and/or directories

[ Top ]


Documentation generated on Thu, 17 Jan 2013 10:30:05 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.