Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question/Feature Request: incomplete/skip dataprovider #13

Closed
jrfnl opened this issue Jul 20, 2014 · 4 comments
Closed

Question/Feature Request: incomplete/skip dataprovider #13

jrfnl opened this issue Jul 20, 2014 · 4 comments

Comments

@jrfnl
Copy link
Collaborator

jrfnl commented Jul 20, 2014

Hi Sebastian, Jeff,

I'm setting up a small number of tests which need to test a pretty large and varied dataset. To keep this manageable, I've set up an abstract class which contains the actual test and a large number of concrete classes which basically only contain the data provider method for that data-subset for use by the test.

For a some of the datasets I haven't actually received/set up any test data yet. I'd like to mark those as 'Incomplete'.
For some others, I know that with the current codebase they will fail, so for the time being (until the code is fixed), I'd like to mark those for 'Skip'.

Is there any way I can do this ? I.e. mark a data provider method as 'Incomplete'/'skip' ?

Smile,
Juliette


Sample code of the set-up:

<php
// File abstract-class-content-analysis.php
abstract class Content_Analysis extends PHPUnit_Framework_TestCase {
    /**
     * @dataProvider  valid_content
     */
    function testContentAnalysis( $content, $expected) {
        // do some tests
    }
}
?>

<?php
// File ServiceTest.php
include_once( 'abstract-class-content-analysis.php' );

class ServiceTest extends Content_Analysis {

    /**
     * @todo Set up test data
     */
    function valid_content() {
        // Here I would like to mark the data provider as incomplete or for skipping
        return array(
        );
    }
}
?>
@whatthejeff
Copy link
Collaborator

Hi, @jrfnl :)

There's actually an open PR for this (see: sebastianbergmann/phpunit#997). It's basically just waiting on @sebastianbergmann's decision since it's kind of a bigger feature. After reading the zf2 tickets linked in the PR, I think it makes sense.

@whatthejeff
Copy link
Collaborator

I'll go ahead and close this issue and ping @sebastianbergmann to see if we can get some feedback :)

@jrfnl
Copy link
Collaborator Author

jrfnl commented Jul 20, 2014

@whatthejeff Oh.. duh... stupid me, posting this in the website repo, not in the PHPUnit repo ;-) Thanks for pointing me to the open issue, will have a read and +1 it.

@whatthejeff
Copy link
Collaborator

@jrfnl No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants