/** * @param string $type The type of concrete Log subclass to use. * Currently, valid values are 'console', * 'syslog', 'sql', 'file', and 'mcal'. * @param string $name The name of the actually log file, table, or * other specific store to use. Defaults to an * empty string, with which the subclass will * attempt to do something intelligent. * @param string $ident The identity reported to the log system. * @param array $conf A hash containing any additional configuration * information that a subclass might need. * @param int $maxLevel Maximum priority level at which to log. */ public function __construct($type, $name = '', $ident = '', $conf = array(), $maxLevel = PEAR_LOG_DEBUG) { if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('Log.php')) { PHPUnit_Util_Filesystem::collectStart(); require_once 'Log.php'; $this->log = Log::factory($type, $name, $ident, $conf, $maxLevel); foreach (PHPUnit_Util_Filesystem::collectEnd() as $blacklistedFile) { PHPUnit_Util_Filter::addFileToFilter($blacklistedFile, 'PHPUNIT'); } } else { throw new RuntimeException('Log is not available.'); } }
/** * Constructor. * * @param mixed $out */ public function __construct($out = NULL) { if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('Image/GraphViz.php')) { PHPUnit_Util_Filesystem::collectStart(); require_once 'Image/GraphViz.php'; $this->graph = new Image_GraphViz(TRUE, array('overlap' => 'scale', 'splines' => 'true', 'sep' => '.1', 'fontsize' => '8')); parent::__construct($out); foreach (PHPUnit_Util_Filesystem::collectEnd() as $blacklistedFile) { PHPUnit_Util_Filter::addFileToFilter($blacklistedFile, 'PHPUNIT'); } } else { throw new RuntimeException('Image_GraphViz is not available.'); } }
protected function updateTicket($ticketId, $newStatus, $message, $resolution) { if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('XML/RPC2/Client.php')) { PHPUnit_Util_Filesystem::collectStart(); require_once 'XML/RPC2/Client.php'; $ticket = XML_RPC2_Client::create($this->scheme . '://' . $this->username . ':' . $this->password . '@' . $this->hostpath, array('prefix' => 'ticket.')); try { $ticketInfo = $ticket->get($ticketId); } catch (XML_RPC2_FaultException $e) { throw new PHPUnit_Framework_Exception(sprintf("Trac fetch failure: %d: %s\n", $e->getFaultCode(), $e->getFaultString())); } try { printf("Updating Trac ticket #%d, status: %s\n", $ticketId, $newStatus); $ticket->update($ticketId, $message, array('status' => $newStatus, 'resolution' => $resolution)); } catch (XML_RPC2_FaultException $e) { throw new PHPUnit_Framework_Exception(sprintf("Trac update failure: %d: %s\n", $e->getFaultCode(), $e->getFaultString())); } foreach (PHPUnit_Util_Filesystem::collectEnd() as $blacklistedFile) { PHPUnit_Util_Filter::addFileToFilter($blacklistedFile, 'PHPUNIT'); } } else { throw new PHPUnit_Framework_Exception('XML_RPC2 is not available.'); } }
* * @category Testing * @package PHPUnit * @author Sebastian Bergmann <*****@*****.**> * @copyright 2002-2009 Sebastian Bergmann <*****@*****.**> * @license http://www.opensource.org/licenses/bsd-license.php BSD License * @version SVN: $Id: PhptTestCase.php 4528 2009-01-21 14:16:59Z sb $ * @link http://www.phpunit.de/ * @since File available since Release 3.1.4 */ if (PHPUnit_Util_Filesystem::fileExistsInIncludePath('PEAR/RunTest.php')) { $currentErrorReporting = error_reporting(E_ERROR | E_WARNING | E_PARSE); PHPUnit_Util_Filesystem::collectStart(); require_once 'PEAR/RunTest.php'; error_reporting($currentErrorReporting); foreach (PHPUnit_Util_Filesystem::collectEnd() as $blacklistedFile) { PHPUnit_Util_Filter::addFileToFilter($blacklistedFile, 'PHPUNIT'); } } require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Extensions/PhptTestCase/Logger.php'; require_once 'PHPUnit/Util/Filter.php'; PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT'); /** * Wrapper to run .phpt test cases. * * @category Testing * @package PHPUnit * @author Sebastian Bergmann <*****@*****.**> * @copyright 2002-2009 Sebastian Bergmann <*****@*****.**> * @license http://www.opensource.org/licenses/bsd-license.php BSD License