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

Class: PHPUnit_GUI_Gtk

Source Location: /PHPUnit-1.3.0/PHPUnit/GUI/Gtk.php

Class Overview


GTK GUI interface for PHPUnit.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2002-2005 Sebastian Bergmann <sb@sebastian-bergmann.de>

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 66]
GTK GUI interface for PHPUnit.

This class is a PHP port of junit.awtui.testrunner. Documentation for junit.awtui.testrunner can be found at http://junit.sourceforge.net

Due to the limitations of PHP4 and PHP-Gtk, this class can not duplicate all of the functionality of the JUnit GUI. Some of the things this class cannot do include:

  • Reloading the class for each run
  • Stopping the test in progress
To use simply intantiate the class and call main() $gtk =& new PHPUnit_GUI_Gtk; $gtk->main();

Once the window has finished loading, you can enter the name of a class that has been loaded (include/require some where in your code, or you can pass the name of the file containing the class.

You can also load classes using the SetupDecorator class. require_once 'PHPUnit/GUI/SetupDecorator.php'; require_once 'PHPUnit/GUI/Gtk.php'; $gui = new PHPUnit_GUI_SetupDecorator(new PHPUnit_GUI_Gtk()); $gui->getSuitesFromDir('/path/to/test','.*\.php$',array('index.php','sql.php')); $gui->show();



[ Top ]


Class Variables

$dumpArea =

[line 113]

The text area for reporting errors encountered when running tests.

Type:   object


[ Top ]

$gui =

[line 72]

The main gtk window

Type:   object


[ Top ]

$numberOfErrors =

[line 90]

The label that shows the number of errors that were encountered.

Type:   object


[ Top ]

$numberOfFailures =

[line 96]

The label that shows the number of failures that were encountered.

Type:   object


[ Top ]

$numberOfRuns =

[line 84]

The label that shows the number of tests that were run.

Type:   object


[ Top ]

$progress =

[line 119]

The progress bar indicator. Shows the percentage of passed tests.

Type:   object


[ Top ]

$reportArea =

[line 107]

The text area for reporting messages from successful

test runs. (not necessarily successful tests)


Type:   object


[ Top ]

$showPassed =

[line 125]

A checkbox for the user to indicate whether or not they would like to see results from all tests or just failures.

Type:   mixed


[ Top ]

$statusLine =

[line 101]

The label for reporting user messages.

Type:   object


[ Top ]

$suiteField =

[line 78]

The text entry that contains the name of the file that holds the test(s)/suite(s).

Type:   object


[ Top ]



Method Detail

PHPUnit_GUI_Gtk (Constructor)   [line 138]

void PHPUnit_GUI_Gtk( none 0)

Constructor.

The constructor checks for the gtk extension and loads it if needed. Then it creates the GUI. The GUI is not shown nor is the main gtk loop started until main() is called.

  • Access: public

Parameters:

none   0   — 

[ Top ]

about   [line 438]

void about( none 0)

Show a popup with information about the application.

The popup should show information about the version, the author, the license, where to get the latest version and a short description.

  • Access: public

Parameters:

none   0   — 

[ Top ]

addSuites   [line 640]

void addSuites( object $testSuite)

Add a suite to the tests.

This method is require by SetupDecorator. It adds a suite to the the current set of suites.

  • Access: public

Parameters:

object   $testSuite   —  The suite to add.

[ Top ]

loadTest   [line 493]

&object &loadTest( string &$file)

Load the test suite.

This method tries to load test suite based on the user info. If the user passes the name of a tests suite, it is instantiated and a new object is returned. If the user passes a file that contains a test suite, the class is instantiated and a new object is returned. If the user passes a file that contains a test case, the test case is passed to a new test suite and the new suite object is returned.

  • Return: The new test suite.
  • Access: public

Parameters:

string   &$file   —  The file that contains a test case/suite or the classname.

[ Top ]

main   [line 159]

void main( [boolean $showPassed = true])

Start the main gtk loop.

main() first sets the default state of the showPassed check box. Next all widgets that are part of the GUI are shown. Finally the main gtk loop is started.

  • Access: public

Parameters:

boolean   $showPassed   — 

[ Top ]

run   [line 592]

void run( none 0)

The main work of the application.

Load the test suite and then execute the tests.

  • Access: public

Parameters:

none   0   — 

[ Top ]

runTest   [line 533]

void runTest( none 0)

Run the test suite.

This method runs the test suite and updates the messages for the user. When finished it changes the status line to 'Test Complete'

  • Access: public

Parameters:

none   0   — 

[ Top ]

show   [line 625]

void show( [ $showPassed = true])

Alias for main()

Parameters:

   $showPassed   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:17:01 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.