mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
chore: adjusts tests
This commit is contained in:
@ -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.
|
||||
*
|
||||
|
||||
@ -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')),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -11,6 +11,6 @@ final class NotesTestCaseFilter implements TestCaseMethodFilter
|
||||
{
|
||||
public function accept(TestCaseMethodFactory $factory): bool
|
||||
{
|
||||
return count($factory->notes) > 0;
|
||||
return $factory->notes !== [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user