chore: adjusts tests

This commit is contained in:
Nuno Maduro
2024-06-27 01:41:34 +01:00
parent 5c3bf469d5
commit 474b9b7e17
10 changed files with 41 additions and 14 deletions

View File

@ -613,8 +613,6 @@ final class Expectation
/**
* Asserts that the given expectation target to use the given trait.
*
* @param string $trait
*/
public function toUseTrait(string $trait): ArchExpectation
{
@ -703,8 +701,6 @@ final class Expectation
);
}
/**
* Asserts that the given expectation target to implement the given interfaces.
*

View File

@ -254,8 +254,6 @@ final class OppositeExpectation
/**
* Asserts that the given expectation target not to use the given trait.
*
* @param string $trait
*/
public function toUseTrait(string $trait): ArchExpectation
{
@ -282,8 +280,8 @@ final class OppositeExpectation
return true;
},
"not to use traits '" . implode("', '", $traits) . "'",
FileLineFinder::where(fn(string $line): bool => str_contains($line, 'class')),
"not to use traits '".implode("', '", $traits)."'",
FileLineFinder::where(fn (string $line): bool => str_contains($line, 'class')),
);
}

View File

@ -31,7 +31,7 @@ final class ExceptionTrace
$message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);
if (class_exists((string) $class) && (is_countable(class_parents($class)) ? count(class_parents($class)) : 0) > 0 && array_values(class_parents($class))[0] === TestCase::class) { // @phpstan-ignore-line
$message .= '. Did you forget to use the [pest()->uses()] function? Read more at: https://pestphp.com/docs/configuring-tests';
$message .= '. Did you forget to use the [pest()->extend()] function? Read more at: https://pestphp.com/docs/configuring-tests';
}
Reflection::setPropertyValue($throwable, 'message', $message);

View File

@ -11,6 +11,6 @@ final class NotesTestCaseFilter implements TestCaseMethodFilter
{
public function accept(TestCaseMethodFactory $factory): bool
{
return count($factory->notes) > 0;
return $factory->notes !== [];
}
}