collectStart() public static method

Starts the collection of loaded files.
public static collectStart ( )
示例#1
0
 /**
  * @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.');
     }
 }
示例#2
0
 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()));
         }
         PHPUnit_Util_Filesystem::collectEndAndAddToBlacklist();
     } else {
         throw new PHPUnit_Framework_Exception('XML_RPC2 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.');
     }
 }
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @package    PHPUnit
 * @subpackage Extensions_PhptTestCase
 * @author     Sebastian Bergmann <*****@*****.**>
 * @copyright  2002-2010 Sebastian Bergmann <*****@*****.**>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @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);
    PHPUnit_Util_Filesystem::collectEndAndAddToBlacklist();
}
require_once 'PHP/CodeCoverage.php';
require_once 'PHP/Timer.php';
/**
 * Wrapper to run .phpt test cases.
 *
 * @package    PHPUnit
 * @subpackage Extensions_PhptTestCase
 * @author     Sebastian Bergmann <*****@*****.**>
 * @copyright  2002-2010 Sebastian Bergmann <*****@*****.**>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@