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

Group Files not working with a non-empty data provider (regression since #3311) #3472

Closed
motin opened this issue Aug 29, 2016 · 3 comments
Closed
Labels

Comments

@motin
Copy link
Contributor

@motin motin commented Aug 29, 2016

This is just strange. Most of our unit tests were suddenly not executed after the upgrade from 2.2.2 to 2.2.3. Tracked this down that the test method that has a dataprovider (that provides some data) are ignored when using a group argument.

This

<?php

class FooTest extends \Codeception\Test\Unit
{

    /**
     * @var \DbAgnosticCodeGuy
     */
    protected $guy;

    protected function _before()
    {
    }

    protected function _after()
    {
    }

    // tests


    public function dataProviderFoo()
    {
        return [
        ];
    }

    /**
     * @group coverage:full
     * @dataProvider dataProviderFoo
     */
    public function testMe($foo = 'bar')
    {
        $this->assertEquals('foo', $foo);
    }

}

... but this one does not work (the testMe is ignored). The only difference is that the dataprovider provides some data.

<?php

class FooTest extends \Codeception\Test\Unit
{

    /**
     * @var \DbAgnosticCodeGuy
     */
    protected $guy;

    protected function _before()
    {
    }

    protected function _after()
    {
    }

    // tests


    public function dataProviderFoo()
    {
        return [
            [],
        ];
    }

    /**
     * @group coverage:full
     * @dataProvider dataProviderFoo
     */
    public function testMe($foo = 'bar')
    {
        $this->assertEquals('foo', $foo);
    }

}

Git bisecting showed that this behavior started after #3311 was merged.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Sep 21, 2016

@eXorus you caused it, can you fix it?

@eXorus
Copy link
Member

@eXorus eXorus commented Sep 22, 2016

@Naktibalda of course I will try to fix it today. Sorry for that

Naktibalda added a commit that referenced this issue Sep 22, 2016
@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Sep 22, 2016

Fixed

@Naktibalda Naktibalda closed this Sep 22, 2016
chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.