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( [array $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( array $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 Mon, 11 Mar 2019 15:52:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.