-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
151 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
tests/end-to-end/_files/attribute-based-filtering/src/autoload.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
require __DIR__ . '/f.php'; | ||
|
||
require __DIR__ . '/Foo.php'; |
15 changes: 15 additions & 0 deletions
15
tests/end-to-end/_files/attribute-based-filtering/src/f.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\AttributeBasedFiltering; | ||
|
||
function f(): bool | ||
{ | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/end-to-end/_files/attribute-based-filtering/tests/CoversFunctionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\AttributeBasedFiltering; | ||
|
||
use PHPUnit\Framework\Attributes\CoversFunction; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[CoversFunction('PHPUnit\TestFixture\AttributeBasedFiltering\f')] | ||
final class CoversFunctionTest extends TestCase | ||
{ | ||
public function testOne(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/end-to-end/_files/attribute-based-filtering/tests/UsesFunctionTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TestFixture\AttributeBasedFiltering; | ||
|
||
use PHPUnit\Framework\Attributes\UsesFunction; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[UsesFunction('PHPUnit\TestFixture\AttributeBasedFiltering\f')] | ||
final class UsesFunctionTest extends TestCase | ||
{ | ||
public function testOne(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
phpunit --covers PHPUnit\TestFixture\AttributeBasedFiltering\f | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--covers'; | ||
$_SERVER['argv'][] = 'PHPUnit\TestFixture\AttributeBasedFiltering\f'; | ||
$_SERVER['argv'][] = __DIR__ . '/../../_files/attribute-based-filtering'; | ||
|
||
require_once __DIR__ . '/../../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (5 tests) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Suite Filtered (1 test) | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (CLI Arguments, 1 test) | ||
Test Suite Started (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest, 1 test) | ||
Test Preparation Started (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest::testOne) | ||
Test Prepared (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest::testOne) | ||
Test Passed (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest::testOne) | ||
Test Finished (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest::testOne) | ||
Test Suite Finished (PHPUnit\TestFixture\AttributeBasedFiltering\CoversFunctionTest, 1 test) | ||
Test Suite Finished (CLI Arguments, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--TEST-- | ||
phpunit --covers PHPUnit\TestFixture\AttributeBasedFiltering\f | ||
--FILE-- | ||
<?php declare(strict_types=1); | ||
$_SERVER['argv'][] = '--do-not-cache-result'; | ||
$_SERVER['argv'][] = '--no-configuration'; | ||
$_SERVER['argv'][] = '--debug'; | ||
$_SERVER['argv'][] = '--uses'; | ||
$_SERVER['argv'][] = 'PHPUnit\TestFixture\AttributeBasedFiltering\f'; | ||
$_SERVER['argv'][] = __DIR__ . '/../../_files/attribute-based-filtering'; | ||
|
||
require_once __DIR__ . '/../../../bootstrap.php'; | ||
|
||
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']); | ||
--EXPECTF-- | ||
PHPUnit Started (PHPUnit %s using %s) | ||
Test Runner Configured | ||
Event Facade Sealed | ||
Test Suite Loaded (5 tests) | ||
Test Runner Started | ||
Test Suite Sorted | ||
Test Suite Filtered (1 test) | ||
Test Runner Execution Started (1 test) | ||
Test Suite Started (CLI Arguments, 1 test) | ||
Test Suite Started (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest, 1 test) | ||
Test Preparation Started (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest::testOne) | ||
Test Prepared (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest::testOne) | ||
Test Passed (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest::testOne) | ||
Test Finished (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest::testOne) | ||
Test Suite Finished (PHPUnit\TestFixture\AttributeBasedFiltering\UsesFunctionTest, 1 test) | ||
Test Suite Finished (CLI Arguments, 1 test) | ||
Test Runner Execution Finished | ||
Test Runner Finished | ||
PHPUnit Finished (Shell Exit Code: 0) |