mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
33 lines
950 B
PHP
33 lines
950 B
PHP
<?php
|
|
|
|
use Pest\Actions\AddsTests;
|
|
use PHPUnit\Framework\TestCase as PhpUnitTestCase;
|
|
use PHPUnit\Framework\TestSuite;
|
|
use PHPUnit\Framework\WarningTestCase;
|
|
|
|
$closure = function () {
|
|
};
|
|
$pestTestCase = new class() extends \PHPUnit\Framework\TestCase {
|
|
};
|
|
|
|
test('default php unit tests', function () {
|
|
$testSuite = new TestSuite();
|
|
|
|
$phpUnitTestCase = new class() extends PhpUnitTestCase {
|
|
};
|
|
$testSuite->addTest($phpUnitTestCase);
|
|
expect($testSuite->tests())->toHaveCount(1);
|
|
|
|
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd(), 'tests'));
|
|
expect($testSuite->tests())->toHaveCount(1);
|
|
});
|
|
|
|
it('removes warnings', function () {
|
|
$testSuite = new TestSuite();
|
|
$warningTestCase = new WarningTestCase('No tests found in class "Pest\TestCase".');
|
|
$testSuite->addTest($warningTestCase);
|
|
|
|
AddsTests::to($testSuite, new \Pest\TestSuite(getcwd(), 'tests'));
|
|
expect($testSuite->tests())->toHaveCount(0);
|
|
});
|