fix: test suite

This commit is contained in:
Nuno Maduro
2024-04-28 11:02:24 +01:00
parent cfa00da885
commit 335bfdb79d
9 changed files with 65 additions and 17 deletions

View File

@ -195,7 +195,7 @@ trait Testable
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
$description = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
$description = htmlspecialchars(html_entity_decode($description), ENT_NOQUOTES);
$description = htmlspecialchars(html_entity_decode((string) $description), ENT_NOQUOTES);
if ($method->repetitions > 1) {
$matches = [];

View File

@ -72,13 +72,13 @@ final class Thanks
}
if ($wantsToSupport === true) {
if (PHP_OS_FAMILY == 'Darwin') {
if (PHP_OS_FAMILY === 'Darwin') {
exec('open https://github.com/pestphp/pest');
}
if (PHP_OS_FAMILY == 'Windows') {
if (PHP_OS_FAMILY === 'Windows') {
exec('start https://github.com/pestphp/pest');
}
if (PHP_OS_FAMILY == 'Linux') {
if (PHP_OS_FAMILY === 'Linux') {
exec('xdg-open https://github.com/pestphp/pest');
}
}

View File

@ -129,7 +129,7 @@ final class Converter
// Format stacktrace as `at <path>`
$frames = array_map(
fn (string $frame) => "at $frame",
fn (string $frame): string => "at $frame",
$frames
);

View File

@ -9,5 +9,14 @@ namespace Pest\PendingCalls\Concerns;
*/
trait Describable
{
/**
* Note: this is property is not used; however,
* it gets added automatically by rector php.
*/
public string $__describing;
/**
* The describing of the test case.
*/
public ?string $describing = null;
}

View File

@ -40,7 +40,7 @@ final class Only implements Terminable
*/
public static function enable(TestCall $testCall): void
{
if (Environment::name() == Environment::CI) {
if (Environment::name() === Environment::CI) {
return;
}

View File

@ -26,7 +26,7 @@ final class Laravel implements HandlesArguments
*/
public function handleArguments(array $arguments): array
{
return self::whenUsingLaravel($arguments, function (array $arguments): array {
return $this->whenUsingLaravel($arguments, function (array $arguments): array {
$this->ensureRunnerIsResolvable();
$arguments = $this->ensureEnvironmentVariables($arguments);
@ -42,7 +42,7 @@ final class Laravel implements HandlesArguments
* @param CLosure(array<int, string>): array<int, string> $closure
* @return array<int, string>
*/
private static function whenUsingLaravel(array $arguments, Closure $closure): array
private function whenUsingLaravel(array $arguments, Closure $closure): array
{
$isLaravelApplication = InstalledVersions::isInstalled('laravel/framework', false);
$isLaravelPackage = class_exists(\Orchestra\Testbench\TestCase::class);