Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Return all the values of an array
<?php array_values(array $array): array
<?php TestSuite::getInstance()->tests->makeIfNeeded($suiteClassFile);
})();
$loadedClasses = array_values(
array_diff(
get_declared_classes(),
array_merge(
self::$declaredClasses,
self::$loadedClasses
)
)
);
self::$loadedClasses = array_merge($loadedClasses, self::$loadedClasses);
<?php }
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
$testParameterTypes = array_values(Reflection::getFunctionArguments($underlyingTest));
if (count($arguments) !== 1) {
foreach ($arguments as $argumentIndex => $argumentValue) {
<?php return [$boundDatasetResult];
}
return array_values($boundDatasetResult);
}
<?php {
$filename = Backtrace::file();
return new UsesCall($filename, array_values($classAndTraits));
}
}
<?php ...$result->testErroredEvents(),
...$result->testFailedEvents(),
...$result->testSkippedEvents(),
...array_merge(...array_values($result->testConsideredRiskyEvents())),
...$result->testMarkedIncompleteEvents(),
];
<?php public function group(string ...$groups): self
{
$this->groups = array_values($groups);
return $this;
}
<?php unset($arguments[$argument]);
return array_values(array_flip($arguments));
}
}
<?php public function handleArguments(array $originals): array
{
$arguments = [...[''], ...array_values(array_filter($originals, function (string $original): bool {
foreach ([self::COVERAGE_OPTION, self::MIN_OPTION] as $option) {
if ($original === sprintf('--%s', $option)) {
return true;
}
if (Str::startsWith($original, sprintf('--%s=', $option))) {
return true;
}
}
return false;
}))];
$originals = array_flip($originals);
foreach ($arguments as $argument) {
<?php }
}
return array_values($arguments);
}
<?php $testResultSum->testTriggeredPhpunitErrorEvents(),
$testResultSum->testTriggeredPhpunitWarningEvents(),
$testResultSum->testRunnerTriggeredDeprecationEvents(),
array_values(array_filter(
$testResultSum->testRunnerTriggeredWarningEvents(),
fn (WarningTriggered $event): bool => ! str_contains($event->message(), 'No tests found')
)),
$testResultSum->errors(),
$testResultSum->deprecations(),
$testResultSum->notices(),
<?php {
$files = [
...array_values(array_filter(
$suiteLoader->tests,
fn (string $filename): bool => ! str_ends_with($filename, "eval()'d code")
)),
...TestSuite::getInstance()->tests->getFilenames(),
];
<?php public function getFilenames(): array
{
return array_values(array_map(static fn (TestCaseFactory $factory): string => $factory->filename, $this->testCases));
}
<?php $testRunnerTriggeredWarningEvents = $property->getValue($collector);
$testRunnerTriggeredWarningEvents = array_values(array_filter($testRunnerTriggeredWarningEvents, fn (WarningTriggered $event): bool => $event->message() !== 'No tests found in class "Pest\TestCases\IgnorableTestCase".'));
$property->setValue($collector, $testRunnerTriggeredWarningEvents);
}
<?php $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 [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests';
}
<?php '# Object \(…\)#' => '',
];
return (string) preg_replace(array_keys($map), array_values($map), $this->exporter->shortenedExport($value));
}
}