Source for file TestCase.php
Documentation is available at TestCase.php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
* This file is part of the PEAR Testing_DocTest package.
* LICENSE: This source file is subject to the MIT license that is available
* through the world-wide-web at the following URI:
* http://opensource.org/licenses/mit-license.php
* @package Testing_DocTest
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2008 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @link http://pear.php.net/package/Testing_DocTest
* @since File available since release 0.1.0
* This class represents a <code></code> block that contains the doc test.
* $tb = new Testing_DocTest_TestCase();
* $tb->level = 'function';
* $tb->name = 'someFunction';
* $tb->altname = 'Alt name';
* // function someFunction
* @package Testing_DocTest
* @author David JEAN LOUIS <izimobil@gmail.com>
* @copyright 2008 David JEAN LOUIS
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: 0.6.0
* @link http://pear.php.net/package/Testing_DocTest
* @since Class available since release 0.1.0
* State of the test before it is run.
* State of a test that have been skipped.
* State of a test that passed.
* State of a test that failed.
* State of a test that had a php error.
* The registry items array.
* @var array $_properties
private $_properties = array (
'state' => self ::STATE_NOT_RUN ,
* Array of ini settings to pass to the process of the testcase.
* @var array $iniSettings
'output_buffering' => '0',
'error_prepend_string' => '',
'error_append_string' => '',
'auto_prepend_file' => '',
'auto_append_file' => '',
* String representation of the test.
* @param string $name name of property
* @param mixed $value value of property
public function __set($name, $value)
$this->_properties[$name] = $value;
* @param string $name name of property
public function __get($name)
if (isset ($this->_properties[$name])) {
if ($this->altname !== null ) {
return $this->level . ' ' . $this->_properties['name'];
return $this->_properties[$name];
* Return true if the test has the flag $flag set or not.
* require_once "Testing/DocTest.php";
* $test = new Testing_DocTest_TestCase();
* $test->flags = Testing_DocTest::FLAG_ELLIPSIS
* | Testing_DocTest::FLAG_NORMALIZE_WHITESPACE
* | Testing_DocTest::FLAG_CASE_INSENSITIVE;
* $test->flags &= ~Testing_DocTest::FLAG_CASE_INSENSITIVE;
* var_dump($test->flags);
* var_dump($test->hasFlag(Testing_DocTest::FLAG_ELLIPSIS));
* var_dump($test->hasFlag(Testing_DocTest::FLAG_NORMALIZE_WHITESPACE));
* var_dump($test->hasFlag(Testing_DocTest::FLAG_CASE_INSENSITIVE));
* @param int $flag one of the DOCTEST::FLAG_* constants.
return ($this->flags & $flag) === $flag;
Documentation generated on Mon, 11 Mar 2019 15:52:27 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|