-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to disable time limits per-class or per-method level (#6)
- Loading branch information
1 parent
3951ef2
commit ecf8d80
Showing
5 changed files
with
144 additions
and
10 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
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,36 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of NexusPHP Tachycardia. | ||
* | ||
* (c) 2021 John Paul E. Balandan, CPA <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nexus\PHPUnit\Extension\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @noTimeLimit | ||
* | ||
* @internal | ||
*/ | ||
final class NoTimeLimitInClassTest extends TestCase | ||
{ | ||
/** | ||
* This should not be reported as slow since | ||
* this is explicitly disabled. | ||
* | ||
* @return void | ||
*/ | ||
public function testSlowTestDisabledForProfiling(): void | ||
{ | ||
usleep(1500000); | ||
self::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of NexusPHP Tachycardia. | ||
* | ||
* (c) 2021 John Paul E. Balandan, CPA <[email protected]> | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Nexus\PHPUnit\Extension\Tests; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
final class NoTimeLimitInMethodTest extends TestCase | ||
{ | ||
/** | ||
* This should be reported as slow. | ||
* | ||
* @return void | ||
*/ | ||
public function testSlowTestNotDisabled(): void | ||
{ | ||
usleep(1500000); | ||
self::assertTrue(true); | ||
} | ||
|
||
/** | ||
* This should not be reported as slow since | ||
* this is explicitly disabled. | ||
* | ||
* @noTimeLimit | ||
* | ||
* @return void | ||
*/ | ||
public function testSlowTestDisabledForProfiling(): void | ||
{ | ||
usleep(1500000); | ||
self::assertTrue(true); | ||
} | ||
} |