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

Comments

Projects
None yet
3 participants
@motin
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Sep 21, 2016

Member

@eXorus you caused it, can you fix it?

Member

Naktibalda commented Sep 21, 2016

@eXorus you caused it, can you fix it?

@eXorus

This comment has been minimized.

Show comment
Hide comment
@eXorus

eXorus Sep 22, 2016

Contributor

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

Contributor

eXorus commented Sep 22, 2016

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

@eXorus eXorus referenced this issue Sep 22, 2016

Merged

Fix issue #3472 #3538

Naktibalda added a commit that referenced this issue Sep 22, 2016

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Sep 22, 2016

Member

Fixed

Member

Naktibalda commented Sep 22, 2016

Fixed

@Naktibalda Naktibalda closed this Sep 22, 2016

chris1312 added 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