Files
pest/tests/PHPUnit/CustomTestCaseInSubFolders/SubFolder2/UsesPerFile.php
2024-09-03 14:09:03 +01:00

26 lines
472 B
PHP

<?php
trait MyCustomTrait
{
public function assertFalseIsFalse()
{
assertFalse(false);
}
}
abstract class MyCustomClass extends PHPUnit\Framework\TestCase
{
public function assertTrueIsTrue()
{
$this->assertTrue(true);
}
}
pest()->extend(MyCustomClass::class)->use(MyCustomTrait::class);
test('custom traits can be used', function () {
$this->assertTrueIsTrue();
});
test('trait applied in this file')->assertTrueIsTrue();