Skip to content

Commit

Permalink
Test case for #2922
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and sebastianbergmann committed Dec 17, 2017
1 parent 8f259e0 commit 58cc67d
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/TextUI/dataprovider-issue-2922.phpt
@@ -0,0 +1,18 @@
--TEST--
phpunit --exclude-group=foo ../_files/DataProviderIssue2922
--FILE--
<?php
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = '--exclude-group=foo';
$_SERVER['argv'][3] = __DIR__ . '/../_files/DataProviderIssue2922';

require __DIR__ . '/../bootstrap.php';
PHPUnit_TextUI_Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

. 1 / 1 (100%)

Time: %s, Memory: %s

OK (1 test, 1 assertion)
24 changes: 24 additions & 0 deletions tests/_files/DataProviderIssue2922/FirstTest.php
@@ -0,0 +1,24 @@
<?php

namespace Foo\DataProviderIssue2922;

use PHPUnit\Framework\TestCase;

/**
* @group foo
*/
class FirstTest extends TestCase
{
/**
* @dataProvider provide
*/
public function testFirst($x)
{
$this->assertTrue(true);
}

public function provide()
{
throw new \FooException();
}
}
14 changes: 14 additions & 0 deletions tests/_files/DataProviderIssue2922/SecondTest.php
@@ -0,0 +1,14 @@
<?php

namespace Foo\DataProviderIssue2922;

use PHPUnit\Framework\TestCase;

// the name of the class cannot match file name - if they match all is fine
class SecondHelloWorldTest extends TestCase
{
public function testSecond()
{
$this->assertTrue(true);
}
}

0 comments on commit 58cc67d

Please sign in to comment.