FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15928&edit=1

ID: 15928
Updated by: sofiacardita@gmail.com
Reported By: sofiacardita at gmail dot com
Summary: Add 'skip all tests except' option to phpdt
Status: Open
Type: Feature/Change Request
Package: Testing_DocTest
Operating System: mac
PHP Version: 5.2.5
Roadmap Versions:
New Comment:

Just noticed that the line

$reg = Testing_DocTest_Registry::singleton();

in the method parse of doctest/parser/default.php should not be inside

the foreach loops but just before them, around line 177 so that we have


[..]
$reg = Testing_DocTest_Registry::singleton();
foreach ($files as $file) {
[..]

and later we have

[..]
//skip all tests except option
if ($reg->skipallexcept && $reg->skipallexcept !=
trim($this->_testCase-
altname)) {
$this->_testCase->flags |= constant('Testing_DocTest::FLAG_SKIP');
}
[..]


Previous Comments:
------------------------------------------------------------------------

[2009-02-22 20:17:35] sofia

Description:
------------
Say I have a class that has several doctests in it and I'm
currently
only working on one of the class methods. I would like a way to run
only
the test specified instead of all the tests in the class. That way I
don't
have to wait for all the tests to run to see the output of the method
I'm
currently testing. I've implemented a way to do this which is in the
test
script section. It would be used like this:
phpdt -s "doctest name" file.php
I was unsure about the name, it could also be runonly but since there
was already a skip if flag it seemed more in tune with the project but
feel
free to change as you see fit.

Test script:
---------------
FILE: phpdt (around line 75)

$parser->addOption('skipallexcept', array(
'short_name' => '-s',
'long_name' => '--skipallexcept',
'description' => 'Skip all tests except ?.',
'action' => 'StoreString'
));

FILE: doctest/parser/default.php->parse() (around line 235)

//skip all tests except option
$reg = Testing_DocTest_Registry::singleton();
if ($reg->skipallexcept && $reg->skipallexcept !=
trim($this->_testCase->altname)) {
$this->_testCase->flags |=
constant('Testing_DocTest::FLAG_SKIP');
}
// end skip all tests except option

(after the 'trim last eol' and before the 'reset state' code)

Expected result:
----------------


Actual result:
--------------

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedFeb 22, '09 at 8:29p
activeFeb 22, '09 at 8:29p
posts1
users1
websitepear.php.net

1 user in discussion

Sofiacardita: 1 post

People

Translate

site design / logo © 2022 Grokbase