prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;
use Attribute;
/**
* @immutable
*
... | /**
* @param non-empty-string $environmentVariableName
* @param ?non-empty-string $value
*/
public function __construct(string $environmentVariableName, null|string $value = null)
{
$this->environmentVariableName = $environm | TABLE)]
final readonly class WithEnvironmentVariable
{
/**
* @var non-empty-string
*/
private string $environmentVariableName;
/**
* @var ?non-empty-string
*/
private null|string $value;
| {
"filepath": "src/Framework/Attributes/WithEnvironmentVariable.php",
"language": "php",
"file_size": 1377,
"cut_index": 524,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 8;
}
public function asString(): string
{
return 'error';
}
/**
* @return non-negative-int
*/
public function sortWeight(): int
| nds Known
{
public function isError(): true
| {
"filepath": "src/Framework/TestStatus/Error.php",
"language": "php",
"file_size": 887,
"cut_index": 547,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | true
{
return true;
}
public function asInt(): int
{
return 2;
}
public function asString(): string
{
return 'incomplete';
}
/**
* @return non-negative-int
*/
public function sor | extends Known
{
public function isIncomplete(): | {
"filepath": "src/Framework/TestStatus/Incomplete.php",
"language": "php",
"file_size": 902,
"cut_index": 547,
"middle_length": 52
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;
use Attribute;
/**
* @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibilit... | ring $className
*/
public function __construct(string $className)
{
$this->className = $className;
}
/**
* @return class-string
*/
public function className(): string
{
return $this->className;
}
| e string $className;
/**
* @param class-st | {
"filepath": "src/Framework/Attributes/UsesClassesThatExtendClass.php",
"language": "php",
"file_size": 916,
"cut_index": 606,
"middle_length": 52
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;
use Attribute;
/**
* @immutable
*
* @no-named-arguments Parameter names are not covered by t... | me;
/**
* @param class-string $interfaceName
*/
public function __construct(string $interfaceName)
{
$this->interfaceName = $interfaceName;
}
/**
* @return class-string
*/
public function interfaceName( | class-string
*/
private string $interfaceNa | {
"filepath": "src/Framework/Attributes/UsesClassesThatImplementInterface.php",
"language": "php",
"file_size": 951,
"cut_index": 582,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;
use Attribute;
/**
* @immutable
*
* @no-named-arguments P... | traitName;
/**
* @param trait-string $traitName
*/
public function __construct(string $traitName)
{
$this->traitName = $traitName;
}
/**
* @return trait-string
*/
public function traitName(): string
| * @var trait-string
*/
private string $ | {
"filepath": "src/Framework/Attributes/UsesTrait.php",
"language": "php",
"file_size": 899,
"cut_index": 547,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 7;
}
public function asString(): string
{
return 'failure';
}
/**
* @return non-negative-int
*/
public function sortWeight() | tends Known
{
public function isFailure(): true
| {
"filepath": "src/Framework/TestStatus/Failure.php",
"language": "php",
"file_size": 893,
"cut_index": 547,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | ): true
{
return true;
}
public function asInt(): int
{
return 4;
}
public function asString(): string
{
return 'deprecation';
}
/**
* @return non-negative-int
*/
public function | n extends Known
{
public function isDeprecation( | {
"filepath": "src/Framework/TestStatus/Deprecation.php",
"language": "php",
"file_size": 905,
"cut_index": 547,
"middle_length": 52
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Attributes;
use Attribute;
/**
* @immutabl... | @param non-empty-string $methodName
*/
public function __construct(string $className, string $methodName)
{
$this->className = $className;
$this->methodName = $methodName;
}
/**
* @return class-string
*/
| y class UsesMethod
{
/**
* @var class-string
*/
private string $className;
/**
* @var non-empty-string
*/
private string $methodName;
/**
* @param class-string $className
* | {
"filepath": "src/Framework/Attributes/UsesMethod.php",
"language": "php",
"file_size": 1223,
"cut_index": 518,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 0;
}
public function asString(): string
{
return 'success';
}
/**
* @return non-negative-int
*/
public function sortWeight() | tends Known
{
public function isSuccess(): true
| {
"filepath": "src/Framework/TestStatus/Success.php",
"language": "php",
"file_size": 893,
"cut_index": 547,
"middle_length": 52
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*... | 4 => self::deprecation(),
5 => self::risky(),
6 => self::warning(),
7 => self::failure(),
8 => self::error(),
default => self::unknown(),
};
}
pu | (int $status): self
{
return match ($status) {
0 => self::success(),
1 => self::skipped(),
2 => self::incomplete(),
3 => self::notice(),
| {
"filepath": "src/Framework/TestStatus/TestStatus.php",
"language": "php",
"file_size": 4421,
"cut_index": 614,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 6;
}
public function asString(): string
{
return 'warning';
}
/**
* @return non-negative-int
*/
public function sortWeight() | tends Known
{
public function isWarning(): true
| {
"filepath": "src/Framework/TestStatus/Warning.php",
"language": "php",
"file_size": 893,
"cut_index": 547,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestRunner;
use function array_reverse;
use function class_exists;
use function count;
us... | 'functions' => [],
'methods' => [],
];
foreach ($configuration->source()->deprecationTriggers()['functions'] as $function) {
$deprecationTriggers['functions'][] = $function;
}
foreach ($configurat | ed by the backward compatibility promise for PHPUnit
*/
final readonly class ErrorHandlerBootstrapper
{
public static function bootstrap(Configuration $configuration): void
{
$deprecationTriggers = [
| {
"filepath": "src/Framework/TestRunner/ErrorHandlerBootstrapper.php",
"language": "php",
"file_size": 2022,
"cut_index": 563,
"middle_length": 229
} |
tion assert;
use function extension_loaded;
use function sprintf;
use function xdebug_is_debugger_active;
use AssertionError;
use PHPUnit\Event\Facade;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\IncompleteTestError;
use PHPUnit\Framework\SkippedTest;
use PHPUnit\Fram... | ;
use SebastianBergmann\CodeCoverage\InvalidArgumentException;
use SebastianBergmann\CodeCoverage\Test\Target\TargetCollection;
use SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException;
use SebastianBergmann\Invoker\Invoker;
use SebastianBerg | ErrorHandler;
use PHPUnit\Runner\Exception;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry;
use SebastianBergmann\CodeCoverage\Exception as CodeCoverageException | {
"filepath": "src/Framework/TestRunner/TestRunner.php",
"language": "php",
"file_size": 13828,
"cut_index": 921,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 3;
}
public function asString(): string
{
return 'notice';
}
/**
* @return non-negative-int
*/
public function sortWeight(): i | ends Known
{
public function isNotice(): true
| {
"filepath": "src/Framework/TestStatus/Notice.php",
"language": "php",
"file_size": 890,
"cut_index": 547,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | {
return true;
}
public function asInt(): int
{
return 1;
}
public function asString(): string
{
return 'skipped';
}
/**
* @return non-negative-int
*/
public function sortWeight() | tends Known
{
public function isSkipped(): true
| {
"filepath": "src/Framework/TestStatus/Skipped.php",
"language": "php",
"file_size": 893,
"cut_index": 547,
"middle_length": 52
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestRunner;
use const STDOUT;
use funct... | }
ini_set('xdebug.scream', '0');
// Not every STDOUT target stream is rewindable
$hasRewound = @rewind(STDOUT);
if ($hasRewound && $stdout = @stream_get_contents(STDOUT)) {
$output = $stdout . $output;
| t
*/
final readonly class ChildProcessOutputCollector
{
public static function collect(TestCase $test): string
{
$output = '';
if (!$test->expectsOutput()) {
$output = $test->output();
| {
"filepath": "src/Framework/TestRunner/ChildProcessOutputCollector.php",
"language": "php",
"file_size": 1036,
"cut_index": 513,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestRunner;
use function assert;
use function bin2hex;
use function defined;
use function get_include_path;
use function hrtime;
use function random_bytes;
use function serialize;
use function sprintf;
use function sys_get_temp_dir;
use funct... | \Util\GlobalState;
use PHPUnit\Util\PHP\Job;
use PHPUnit\Util\PHP\JobRunnerRegistry;
use ReflectionClass;
use SebastianBergmann\Template\InvalidArgumentException;
use SebastianBergmann\Template\Template;
/**
* @no-named-arguments Parameter names are not | \Framework\ProcessIsolationException;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\TextUI\Configuration\Registry as ConfigurationRegistry;
use PHPUnit\TextUI\Configuration\SourceMapper;
use PHPUnit | {
"filepath": "src/Framework/TestRunner/SeparateProcessTestRunner.php",
"language": "php",
"file_size": 8148,
"cut_index": 716,
"middle_length": 229
} |
tion
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @see Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys
*/
function assertArrayIsEqualToArrayOnlyConsideringListOfKeys(array $... | $expected
* @param array<mixed> $actual
* @param non-empty-list<array-key> $keysToBeIgnored
*
* @throws Exception
* @throws ExpectationFailedException
*
* @no-named-arguments Parameter names are not | , $message);
}
}
if (!function_exists('PHPUnit\Framework\assertArrayIsEqualToArrayIgnoringListOfKeys')) {
/**
* Asserts that two arrays are equal while ignoring a list of keys.
*
* @param array<mixed> | {
"filepath": "src/Framework/Assert/Functions.php",
"language": "php",
"file_size": 124567,
"cut_index": 3790,
"middle_length": 229
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestStatus;
/**
* @immutable
*
* @no-named-arguments Parameter names a... | true
{
return true;
}
public function asInt(): int
{
return -1;
}
public function asString(): string
{
return 'unknown';
}
/**
* @return non-negative-int
*/
public function sortWe | tends TestStatus
{
public function isUnknown(): | {
"filepath": "src/Framework/TestStatus/Unknown.php",
"language": "php",
"file_size": 899,
"cut_index": 547,
"middle_length": 52
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestRunner;
use function assert;
use function hash_equals;
use function is_int;
use function property_exists;
use function strlen;
use function substr;
use function trim;
use function unserialize;
use PHPUnit\Event\Code\TestMethodBuilder;
use... | **
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final readonly class ChildProcessResultProcessor
{
private Facade $eventFacade;
private Emitter $emitter;
private PassedTests $passe | Exception;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestCase;
use PHPUnit\Runner\CodeCoverage;
use PHPUnit\TestRunner\TestResult\Facade as TestResultFacade;
use PHPUnit\TestRunner\TestResult\PassedTests;
use stdClass;
/ | {
"filepath": "src/Framework/TestRunner/ChildProcessResultProcessor.php",
"language": "php",
"file_size": 5278,
"cut_index": 716,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_float;
use f... | gated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operato | PUnit
*/
final class IsNan extends Constraint
{
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is nan';
}
/**
* Returns the ne | {
"filepath": "src/Framework/Constraint/Math/IsNan.php",
"language": "php",
"file_size": 1855,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
/**
* @no-named-arguments Parameter n... | an value instead: true in case of success, false in case of a
* failure.
*
* @throws void
*/
public function evaluate(mixed $other, string $description = '', bool $returnResult = false): ?bool
{
return $returnResult ? tr | * If $returnResult is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
* a boole | {
"filepath": "src/Framework/Constraint/IsAnything.php",
"language": "php",
"file_size": 1313,
"cut_index": 524,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function json_decode;
use function sprintf;
use PHPUnit\Framework\ExpectationFailedException;
use PH... | tring representation of the object.
*/
public function toString(): string
{
return sprintf(
'matches JSON string "%s"',
$this->value,
);
}
/**
* Returns the negated description when this co | ility promise for PHPUnit
*/
final class JsonMatches extends Constraint
{
private readonly string $value;
public function __construct(string $value)
{
$this->value = $value;
}
/**
* Returns a s | {
"filepath": "src/Framework/Constraint/JsonMatches.php",
"language": "php",
"file_size": 3429,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function preg_last_error_msg;
use function preg_m... | sentation of the constraint.
*/
public function toString(): string
{
return sprintf(
'matches PCRE pattern "%s"',
$this->pattern,
);
}
/**
* Returns the negated description when this constr |
*/
final class RegularExpression extends Constraint
{
private readonly string $pattern;
public function __construct(string $pattern)
{
$this->pattern = $pattern;
}
/**
* Returns a string repre | {
"filepath": "src/Framework/Constraint/String/RegularExpression.php",
"language": "php",
"file_size": 2232,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function str_ends_with;... | on;
}
$this->suffix = $suffix;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'ends with "' . $this->suffix . '"';
}
/**
* Returns | s Constraint
{
private readonly string $suffix;
/**
* @throws EmptyStringException
*/
public function __construct(string $suffix)
{
if ($suffix === '') {
throw new EmptyStringExcepti | {
"filepath": "src/Framework/Constraint/String/StringEndsWith.php",
"language": "php",
"file_size": 1867,
"cut_index": 537,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function assert;
use function is_string;
use function preg_replace;
use f... | ation of the constraint.
*/
public function toString(): string
{
return 'is equal to ' . $this->valueAsString();
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. Aut | espace extends Constraint
{
private readonly string $string;
public function __construct(string $string)
{
$this->string = $this->normalizeWhitespace($string);
}
/**
* Returns a string represent | {
"filepath": "src/Framework/Constraint/String/StringEqualsStringIgnoringWhitespace.php",
"language": "php",
"file_size": 2197,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function str_starts_wit... | eption;
}
$this->prefix = $prefix;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'starts with "' . $this->prefix . '"';
}
/**
* Re | tends Constraint
{
private readonly string $prefix;
/**
* @throws EmptyStringException
*/
public function __construct(string $prefix)
{
if ($prefix === '') {
throw new EmptyStringExc | {
"filepath": "src/Framework/Constraint/String/StringStartsWith.php",
"language": "php",
"file_size": 1877,
"cut_index": 537,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_float;
use f... | Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Op | or PHPUnit
*/
final class IsInfinite extends Constraint
{
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is infinite';
}
/**
* | {
"filepath": "src/Framework/Constraint/Math/IsInfinite.php",
"language": "php",
"file_size": 1880,
"cut_index": 537,
"middle_length": 229
} |
unction str_replace;
use function strpos;
use function strtolower;
use function substr;
use Countable;
use PHPUnit\Event\Code\NoTestCaseObjectOnCallStackException;
use PHPUnit\Event\Code\TestMethodBuilder;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\ExpectationFailedExce... |
* @param A $actual
*
* @return A
*/
final public function __invoke(mixed $actual): mixed
{
Assert::assertThat($actual, $this);
return $actual;
}
/**
* Evaluates the constraint for parameter $other | mparatorFactory;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
abstract class Constraint implements Countable, SelfDescribing
{
/**
* @template A
* | {
"filepath": "src/Framework/Constraint/Constraint.php",
"language": "php",
"file_size": 10574,
"cut_index": 921,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use const JSON_ERROR_CTRL_CHAR;
use const JSON_ERROR_DEPTH;
use const JSON_ERROR_NONE;
use const JSON_ERROR_STATE_MISMATCH;
use ... | function toString(): string
{
return 'is valid JSON';
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor kee | o-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final class IsJson extends Constraint
{
/**
* Returns a string representation of the constraint.
*/
public | {
"filepath": "src/Framework/Constraint/String/IsJson.php",
"language": "php",
"file_size": 4175,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use function strtr;
/**
* @no... | unction toString(): string
{
return 'is equal to ' . $this->valueAsString();
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. Authoring the negation here keeps the expected v | ly string $string;
public function __construct(string $string)
{
$this->string = $this->normalizeLineEndings($string);
}
/**
* Returns a string representation of the constraint.
*/
public f | {
"filepath": "src/Framework/Constraint/String/StringEqualsStringIgnoringLineEndings.php",
"language": "php",
"file_size": 2169,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_finite;
use ... | ns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator | PHPUnit
*/
final class IsFinite extends Constraint
{
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is finite';
}
/**
* Retur | {
"filepath": "src/Framework/Constraint/Math/IsFinite.php",
"language": "php",
"file_size": 1870,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function gettype;
use function is_array;
use function is_bool;
use function is_callable;
use function is_float;
use function... | ype $type)
{
$this->type = $type;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return sprintf(
'is of type %s',
$this->type->value, |
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
final class IsType extends Constraint
{
private readonly NativeType $type;
public function __construct(NativeT | {
"filepath": "src/Framework/Constraint/Type/IsType.php",
"language": "php",
"file_size": 3140,
"cut_index": 614,
"middle_length": 229
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function get_debug_type... | parent::__construct(
sprintf(
'Method %s may not return value of type %s, its declared return type is "%s"',
$method->name(),
get_debug_type($value),
$method->returnTypeDeclarati | compatibility promise for PHPUnit
*/
final class IncompatibleReturnValueException extends \PHPUnit\Framework\Exception implements Exception
{
public function __construct(ConfigurableMethod $method, mixed $value)
{
| {
"filepath": "src/Framework/MockObject/Exception/IncompatibleReturnValueException.php",
"language": "php",
"file_size": 1038,
"cut_index": 513,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function mb_detect_encoding;
use function mb_stripos;
use function mb_strtolower;
use function sprintf;
use function str_contains;
use function strlen;
use function strtr;
use PHPUnit\Util\Exporter;
/*... | ings) {
$needle = $this->normalizeLineEndings($needle);
}
$this->needle = $needle;
$this->ignoreCase = $ignoreCase;
$this->ignoreLineEndings = $ignoreLineEndings;
}
/**
* Returns | le;
private readonly bool $ignoreCase;
private readonly bool $ignoreLineEndings;
public function __construct(string $needle, bool $ignoreCase = false, bool $ignoreLineEndings = false)
{
if ($ignoreLineEnd | {
"filepath": "src/Framework/Constraint/String/StringContains.php",
"language": "php",
"file_size": 5294,
"cut_index": 716,
"middle_length": 229
} |
de;
use function implode;
use function is_string;
use function preg_last_error_msg;
use function preg_match;
use function preg_quote;
use function preg_replace;
use function sprintf;
use function str_replace;
use function strlen;
use function strpos;
use function strtr;
use function substr;
use PHPUnit\Framework\Except... | $formatDescription;
}
public function toString(): string
{
return 'matches format description:' . PHP_EOL . $this->formatDescription;
}
/**
* Returns the negated description when this constraint is wrapped in a
* Log | for PHPUnit
*/
final class StringMatchesFormatDescription extends Constraint
{
private readonly string $formatDescription;
public function __construct(string $formatDescription)
{
$this->formatDescription = | {
"filepath": "src/Framework/Constraint/String/StringMatchesFormatDescription.php",
"language": "php",
"file_size": 9254,
"cut_index": 921,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function gettype;
use function is_object;
use function is_scalar;
use function sprintf;
use ReflectionObject;
/**
* @no-na... | {
return sprintf(
'has property "%s"',
$this->propertyName,
);
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalA | ;
public function __construct(string $propertyName)
{
$this->propertyName = $propertyName;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
| {
"filepath": "src/Framework/Constraint/Object/ObjectHasProperty.php",
"language": "php",
"file_size": 3215,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_key_exists;
use function is_array;
use function is_int;
us... | public function toString(): string
{
return 'has the key ' . Exporter::export($this->key);
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*/
protected | ArrayHasKey extends Constraint
{
private readonly mixed $key;
public function __construct(mixed $key)
{
$this->key = $key;
}
/**
* Returns a string representation of the constraint.
*/
| {
"filepath": "src/Framework/Constraint/Array/ArrayHasKey.php",
"language": "php",
"file_size": 2606,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function sprintf;
use PHPUnit\Util\Filter;
use Throwable;
/**
* @no-nam... | ion of the constraint.
*/
public function toString(): string
{
return sprintf(
'exception of type "%s"',
$this->className,
);
}
/**
* Evaluates the constraint for parameter $other. Returns | inal class Exception extends Constraint
{
private readonly string $className;
public function __construct(string $className)
{
$this->className = $className;
}
/**
* Returns a string representat | {
"filepath": "src/Framework/Constraint/Exception/Exception.php",
"language": "php",
"file_size": 2086,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use P... | = $expectedMessage;
}
public function toString(): string
{
if ($this->expectedMessage === '') {
return 'exception message is empty';
}
return 'exception message is ' . Exporter::export($this->expectedMessag | mpatibility promise for PHPUnit
*/
final class ExceptionMessageIs extends Constraint
{
private readonly string $expectedMessage;
public function __construct(string $expectedMessage)
{
$this->expectedMessage | {
"filepath": "src/Framework/Constraint/Exception/ExceptionMessageIs.php",
"language": "php",
"file_size": 1957,
"cut_index": 537,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function preg_match;
use function sprintf;
use Ex... | n)
{
$this->regularExpression = $regularExpression;
}
public function toString(): string
{
return 'exception message matches ' . Exporter::export($this->regularExpression);
}
/**
* Evaluates the constraint for | he backward compatibility promise for PHPUnit
*/
final class ExceptionMessageMatchesRegularExpression extends Constraint
{
private readonly string $regularExpression;
public function __construct(string $regularExpressio | {
"filepath": "src/Framework/Constraint/Exception/ExceptionMessageMatchesRegularExpression.php",
"language": "php",
"file_size": 2293,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_map;
use function count;
/**
* @no-named-arguments Parameter names are not covered by the backward compatib... | */
final public function arity(): int
{
return count($this->constraints);
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
$reduced = $this->reduce();
| onstruct(mixed ...$constraints)
{
$this->constraints = array_map(
$this->checkConstraint(...),
$constraints,
);
}
/**
* Returns the number of operands (constraints).
| {
"filepath": "src/Framework/Constraint/Operator/BinaryOperator.php",
"language": "php",
"file_size": 3251,
"cut_index": 614,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function explode;
use function gettype;
use function is_array;
use function is_object;
use function is_string;
use function sprintf;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Util\Exporter;
use SebastianBer... | Result is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
* a boolean value instead: true in case of succes | nds Constraint
{
private readonly mixed $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Evaluates the constraint for parameter $other.
*
* If $return | {
"filepath": "src/Framework/Constraint/IsIdentical.php",
"language": "php",
"file_size": 5234,
"cut_index": 716,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function assert;
use function count;
use function is_bool;
use function is_object;
use PHPUnit\Framework\ActualValueIsNotAnObjectException;
use PHPUnit\Framework\ComparisonMethodDoesNotAcceptParameterTypeException;
use PHPUnit... | promise for PHPUnit
*/
final class ObjectEquals extends Constraint
{
private readonly object $expected;
private readonly string $method;
public function __construct(object $object, string $method = 'equals')
{
$this->expected = $ | tDeclareParameterTypeException;
use PHPUnit\Framework\ComparisonMethodDoesNotExistException;
use ReflectionNamedType;
use ReflectionObject;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility | {
"filepath": "src/Framework/Constraint/Object/ObjectEquals.php",
"language": "php",
"file_size": 5462,
"cut_index": 716,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_is_list;
use function is_array;
/**
* @no-named-argument... | otected function matches(mixed $other): bool
{
if (!is_array($other)) {
return false;
}
return array_is_list($other);
}
/**
* Returns the description of the failure.
*
* The beginning of fail | .
*/
public function toString(): string
{
return 'is a list';
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*/
pr | {
"filepath": "src/Framework/Constraint/Array/IsList.php",
"language": "php",
"file_size": 2142,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use function str_contains;
use ... | tedMessage = $expectedMessage;
}
public function toString(): string
{
if ($this->expectedMessage === '') {
return 'exception message is empty';
}
return 'exception message contains ' . Exporter::export($thi | ompatibility promise for PHPUnit
*/
final class ExceptionMessageIsOrContains extends Constraint
{
private readonly string $expectedMessage;
public function __construct(string $expectedMessage)
{
$this->expec | {
"filepath": "src/Framework/Constraint/Exception/ExceptionMessageIsOrContains.php",
"language": "php",
"file_size": 2107,
"cut_index": 563,
"middle_length": 229
} |
that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_key_exists;
use function array_values;
use function count;
use function is_array;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Util\Exporter;
use SebastianBergmann\Comparator\ComparisonFailure;
... | y $expected, bool $keysMatter, bool $orderMatters)
{
$this->expected = $expected;
$this->keysMatter = $keysMatter;
$this->orderMatters = $orderMatters;
}
/**
* Evaluates the constraint for parameter $other.
| mixed>
*/
protected readonly array $expected;
protected readonly bool $keysMatter;
protected readonly bool $orderMatters;
/**
* @param array<mixed> $expected
*/
public function __construct(arra | {
"filepath": "src/Framework/Constraint/Array/ArrayComparison.php",
"language": "php",
"file_size": 6950,
"cut_index": 716,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_int;
use function is_string;
use fu... | pectedCode = $expected;
}
public function toString(): string
{
return 'exception code is ' . $this->expectedCode;
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false | ed by the backward compatibility promise for PHPUnit
*/
final class ExceptionCode extends Constraint
{
private readonly int|string $expectedCode;
public function __construct(int|string $expected)
{
$this->ex | {
"filepath": "src/Framework/Constraint/Exception/ExceptionCode.php",
"language": "php",
"file_size": 1739,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use const PREG_SPLIT_DELIM_CAPTURE;
use function array_map;
use function assert;
use function preg_quote;
use function preg_repl... | ,
'has ',
'is ',
'are ',
'matches ',
'starts with ',
'ends with ',
'reference ',
'not not ',
];
$negatives = [
'does not contain ', | /
final class LogicalNot extends UnaryOperator
{
/**
* @return non-empty-string
*/
public static function negate(string $string): string
{
$positives = [
'contains ',
'exists' | {
"filepath": "src/Framework/Constraint/Operator/LogicalNot.php",
"language": "php",
"file_size": 4157,
"cut_index": 614,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
/**
* @no-named-arguments Parameter n... | ecedence.
*
* @see https://www.php.net/manual/en/language.operators.precedence.php
*/
public function precedence(): int
{
return 24;
}
/**
* Evaluates the constraint for parameter $other. Returns true if the
| f
{
return new self(...$constraints);
}
/**
* Returns the name of this operator.
*/
public function operator(): string
{
return 'or';
}
/**
* Returns this operator's pr | {
"filepath": "src/Framework/Constraint/Operator/LogicalOr.php",
"language": "php",
"file_size": 1319,
"cut_index": 524,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
/**
* @no-named-arguments Parameter n... | /**
* Returns the number of operands.
*/
abstract public function arity(): int;
/**
* Validates $constraint argument.
*/
protected function checkConstraint(mixed $constraint): Constraint
{
if (!$constraint ins | ublic function operator(): string;
/**
* Returns this operator's precedence.
*
* @see https://www.php.net/manual/en/language.operators.precedence.php
*/
abstract public function precedence(): int;
| {
"filepath": "src/Framework/Constraint/Operator/Operator.php",
"language": "php",
"file_size": 1458,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function sprintf;
use PHPUnit\Util\Exporter;
/**
... | urn 'contains ' . Exporter::export($this->value);
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affi | $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
ret | {
"filepath": "src/Framework/Constraint/Traversable/TraversableContains.php",
"language": "php",
"file_size": 2292,
"cut_index": 563,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_iterable;
use fu... | $value = $this->value();
if ($other instanceof SplObjectStorage) {
if (!is_object($value)) {
return false;
}
return $other->offsetExists($value);
}
if (!is_iterable($other)) { | al extends TraversableContains
{
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*/
protected function matches(mixed $other): bool
{
| {
"filepath": "src/Framework/Constraint/Traversable/TraversableContainsIdentical.php",
"language": "php",
"file_size": 1203,
"cut_index": 518,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_object;
use ... | LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instance | Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is false';
}
/**
* Returns the negated description when this constraint is wrapped in a
* | {
"filepath": "src/Framework/Constraint/Boolean/IsFalse.php",
"language": "php",
"file_size": 1631,
"cut_index": 537,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_dir;
use function is_string;
use function sprintf;
/**
* @n... | tor. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof LogicalNot) {
| ntation of the constraint.
*/
public function toString(): string
{
return 'directory exists';
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot opera | {
"filepath": "src/Framework/Constraint/Filesystem/DirectoryExists.php",
"language": "php",
"file_size": 2369,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_readable;
use function is_string;
use function sprintf;
/**
... | The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof LogicalNot) {
| ntation of the constraint.
*/
public function toString(): string
{
return 'is readable';
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. | {
"filepath": "src/Framework/Constraint/Filesystem/IsReadable.php",
"language": "php",
"file_size": 2346,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function class_exists;
use function interface_exists;
use function sprint... | rfaceException
*/
public function __construct(string $name)
{
if (class_exists($name)) {
$this->type = 'class';
} elseif (interface_exists($name)) {
$this->type = 'interface';
} else {
| nceOf extends Constraint
{
/**
* @var class-string
*/
private readonly string $name;
/**
* @var 'class'|'interface'
*/
private readonly string $type;
/**
* @throws UnknownClassOrInte | {
"filepath": "src/Framework/Constraint/Type/IsInstanceOf.php",
"language": "php",
"file_size": 2921,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_object;
use ... | ogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof | Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is null';
}
/**
* Returns the negated description when this constraint is wrapped in a
* L | {
"filepath": "src/Framework/Constraint/Type/IsNull.php",
"language": "php",
"file_size": 1627,
"cut_index": 537,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function count;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUni... | raint.
*/
public function toString(): string
{
$reduced = $this->reduce();
if ($reduced !== $this) {
return $reduced->toString();
}
$constraint = $this->constraint->reduce();
if ($this->co | checkConstraint($constraint);
}
/**
* Returns the number of operands (constraints).
*/
public function arity(): int
{
return 1;
}
/**
* Returns a string representation of the const | {
"filepath": "src/Framework/Constraint/Operator/UnaryOperator.php",
"language": "php",
"file_size": 3498,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_iterable;
use PHPUnit\Framework\ExpectationFailedException;
u... | /**
* @param class-string $type
*/
public static function forClassOrInterface(string $type): self
{
return new self(new IsInstanceOf($type), $type);
}
private function __construct(IsInstanceOf|IsType $constraint, stri | onstraint
{
private readonly Constraint $constraint;
private readonly string $type;
public static function forNativeType(NativeType $type): self
{
return new self(new IsType($type), $type->value);
}
| {
"filepath": "src/Framework/Constraint/Traversable/TraversableContainsOnly.php",
"language": "php",
"file_size": 2843,
"cut_index": 563,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_array;
use function is_object;
use ... | ogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof | Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is true';
}
/**
* Returns the negated description when this constraint is wrapped in a
* L | {
"filepath": "src/Framework/Constraint/Boolean/IsTrue.php",
"language": "php",
"file_size": 1627,
"cut_index": 537,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function array_reduce;
use function array_shift... | is operator.
*/
public function operator(): string
{
return 'xor';
}
/**
* Returns this operator's precedence.
*
* @see https://www.php.net/manual/en/language.operators.precedence.php.
*/
public functio | for PHPUnit
*/
final class LogicalXor extends BinaryOperator
{
public static function fromConstraints(mixed ...$constraints): self
{
return new self(...$constraints);
}
/**
* Returns the name of th | {
"filepath": "src/Framework/Constraint/Operator/LogicalXor.php",
"language": "php",
"file_size": 1786,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_iterable;
use function... | n matches(mixed $other): bool
{
$value = $this->value();
if ($other instanceof SplObjectStorage) {
if (!is_object($value)) {
return false;
}
return $other->offsetExists($value);
| nit
*/
final class TraversableContainsEqual extends TraversableContains
{
/**
* Evaluates the constraint for parameter $other. Returns true if the
* constraint is met, false otherwise.
*/
protected functio | {
"filepath": "src/Framework/Constraint/Traversable/TraversableContainsEqual.php",
"language": "php",
"file_size": 1377,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function is_writable;
use function sprintf;
/**
... | The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof LogicalNot) {
| ntation of the constraint.
*/
public function toString(): string
{
return 'is writable';
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. | {
"filepath": "src/Framework/Constraint/Filesystem/IsWritable.php",
"language": "php",
"file_size": 2346,
"cut_index": 563,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function file_exists;
use function is_string;
use function sprintf;
/**
... | The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
if (!$operator instanceof LogicalNot) {
| ntation of the constraint.
*/
public function toString(): string
{
return 'file exists';
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. | {
"filepath": "src/Framework/Constraint/Filesystem/FileExists.php",
"language": "php",
"file_size": 2354,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use function str_contains;
use function trim;
use PHPUnit\Framework\ExpectationFai... | ameter $other.
*
* If $returnResult is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
* a boolea | or PHPUnit
*/
final class IsEqual extends Constraint
{
private readonly mixed $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Evaluates the constraint for par | {
"filepath": "src/Framework/Constraint/Equality/IsEqual.php",
"language": "php",
"file_size": 3113,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use function str_contains;
use function trim;
use PHPUnit\Framework\ExpectationFai... | aint for parameter $other.
*
* If $returnResult is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
| or PHPUnit
*/
final class IsEqualIgnoringCase extends Constraint
{
private readonly mixed $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Evaluates the constr | {
"filepath": "src/Framework/Constraint/Equality/IsEqualIgnoringCase.php",
"language": "php",
"file_size": 3143,
"cut_index": 614,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function sprintf;
use function trim;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Util\Exporter;
use Sebast... | * Evaluates the constraint for parameter $other.
*
* If $returnResult is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the eva | Constraint
{
private readonly mixed $value;
private readonly float $delta;
public function __construct(mixed $value, float $delta)
{
$this->value = $value;
$this->delta = $delta;
}
/**
| {
"filepath": "src/Framework/Constraint/Equality/IsEqualWithDelta.php",
"language": "php",
"file_size": 3057,
"cut_index": 614,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function count;
use function gettype;
use function sprintf;
use function ... | raint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
*/
protected function toStringInContext(Operator $operator, mixed $role): string
{
| Constraint
{
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is empty';
}
/**
* Returns the negated description when this const | {
"filepath": "src/Framework/Constraint/Cardinality/IsEmpty.php",
"language": "php",
"file_size": 2638,
"cut_index": 563,
"middle_length": 229
} |
pes=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestSize;
/**
* @no-named-arguments Parameter names are not ... | true
{
return true;
}
public function isGreaterThan(TestSize $other): bool
{
return !$other->isLarge();
}
/**
* @return 'large'
*/
public function asString(): string
{
return 'large';
| Large extends Known
{
public function isLarge(): | {
"filepath": "src/Framework/TestSize/Large.php",
"language": "php",
"file_size": 848,
"cut_index": 535,
"middle_length": 52
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestSize;
/**
* @no-named-arguments Parameter names ar... | edium(): true
{
return true;
}
public function isGreaterThan(TestSize $other): bool
{
return $other->isSmall();
}
/**
* @return 'medium'
*/
public function asString(): string
{
return 'med | class Medium extends Known
{
public function isM | {
"filepath": "src/Framework/TestSize/Medium.php",
"language": "php",
"file_size": 851,
"cut_index": 529,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use SebastianBergmann\Type\Type;
/**
* @no-named-arguments Parameter names ... | e int $numberOfParameters;
private Type $returnType;
/**
* @param non-empty-string $name
* @param array<int, mixed> $defaultParameterValues
* @param non-negative-int $numberOfParameters
*/
public function __construct(stri | bleMethod
{
/**
* @var non-empty-string
*/
private string $name;
/**
* @var array<int, mixed>
*/
private array $defaultParameterValues;
/**
* @var non-negative-int
*/
privat | {
"filepath": "src/Framework/MockObject/ConfigurableMethod.php",
"language": "php",
"file_size": 2059,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function array_merge;
use PHPUnit\Framework\MockObject\Generator\Generator;
use PHPUnit\Framework\MockObject\Generator\Refle... | dsArray = false;
/**
* @var array<mixed>
*/
protected array $constructorArgs = [];
protected bool $originalConstructor = true;
protected bool $originalClone = true;
protected bool $returnValueGeneration = true; | s TestDoubleBuilder
{
/**
* @var class-string<T>
*/
protected readonly string $type;
/**
* @var list<non-empty-string>
*/
protected array $methods = [];
protected bool $emptyMetho | {
"filepath": "src/Framework/MockObject/TestDoubleBuilder.php",
"language": "php",
"file_size": 4397,
"cut_index": 614,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise ... | ring $type, string $methodName)
{
parent::__construct(
sprintf(
'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s"',
$methodName,
$type,
| ments Exception
{
public function __construct(st | {
"filepath": "src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php",
"language": "php",
"file_size": 939,
"cut_index": 606,
"middle_length": 52
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function is_string;
use function sprintf;
use function str_contains;
use function trim;
use PHPUnit\Framework\ExpectationFai... | traint for parameter $other.
*
* If $returnResult is set to false (the default), an exception is thrown
* in case of a failure. null is returned otherwise.
*
* If $returnResult is true, the result of the evaluation is returned as
| or PHPUnit
*/
final class IsEqualCanonicalizing extends Constraint
{
private readonly mixed $value;
public function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Evaluates the cons | {
"filepath": "src/Framework/Constraint/Equality/IsEqualCanonicalizing.php",
"language": "php",
"file_size": 3138,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use PHPUnit\Util\Exporter;
/**
* @no-named-argume... | ter::export($this->value);
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString().
| _construct(mixed $value)
{
$this->value = $value;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is greater than ' . Expor | {
"filepath": "src/Framework/Constraint/Cardinality/GreaterThan.php",
"language": "php",
"file_size": 1512,
"cut_index": 537,
"middle_length": 229
} |
clare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestSize;
/**
* @no-named-arguments Parameter... | tion isSmall(): true
{
return true;
}
public function isGreaterThan(TestSize $other): bool
{
return false;
}
/**
* @return 'small'
*/
public function asString(): string
{
return 'small';
| readonly class Small extends Known
{
public func | {
"filepath": "src/Framework/TestSize/Small.php",
"language": "php",
"file_size": 835,
"cut_index": 520,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function assert;
use PHPUnit\Framework\InvalidArgumentException;
use PHPU... | \Framework\MockObject\Generator\NameAlreadyInUseException;
use PHPUnit\Framework\MockObject\Generator\ReflectionException;
use PHPUnit\Framework\MockObject\Generator\RuntimeException;
use PHPUnit\Framework\MockObject\Generator\UnknownTypeException;
use PHP | eption;
use PHPUnit\Framework\MockObject\Generator\DuplicateMethodException;
use PHPUnit\Framework\MockObject\Generator\InvalidClassNameException;
use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException;
use PHPUnit | {
"filepath": "src/Framework/MockObject/MockBuilder.php",
"language": "php",
"file_size": 2796,
"cut_index": 563,
"middle_length": 229
} |
tian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use function count;
use function is_countable;
use function iterator_count;
use function sprintf;
use EmptyIterator;
use Generat... | pected)
{
$this->expectedCount = $expected;
}
public function toString(): string
{
return sprintf(
'count matches %d',
$this->expectedCount,
);
}
/**
* Returns the negated descr |
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*/
class Count extends Constraint
{
private readonly int $expectedCount;
public function __construct(int $ex | {
"filepath": "src/Framework/Constraint/Cardinality/Count.php",
"language": "php",
"file_size": 4652,
"cut_index": 614,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\TestSize;
/**
* @no-named-arguments Parameter names are not co... | return new Medium;
}
public static function large(): self
{
return new Large;
}
/**
* @phpstan-assert-if-true Known $this
*/
public function isKnown(): bool
{
return false;
}
/**
* @p | TestSize
{
public static function unknown(): self
{
return new Unknown;
}
public static function small(): self
{
return new Small;
}
public static function medium(): self
{
| {
"filepath": "src/Framework/TestSize/TestSize.php",
"language": "php",
"file_size": 1648,
"cut_index": 537,
"middle_length": 229
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\Constraint;
use PHPUnit\Util\Exporter;
/**
* @no... | . Exporter::export($this->value);
}
/**
* Returns the negated description when this constraint is wrapped in a
* LogicalNot operator. The guard ensures that LogicalAnd, LogicalOr, and
* LogicalXor keep using the affirmative toString | function __construct(mixed $value)
{
$this->value = $value;
}
/**
* Returns a string representation of the constraint.
*/
public function toString(): string
{
return 'is less than ' | {
"filepath": "src/Framework/Constraint/Cardinality/LessThan.php",
"language": "php",
"file_size": 1503,
"cut_index": 524,
"middle_length": 229
} |
pes=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @no-named-arguments... | amework\Exception implements Exception
{
public function __construct(string $id)
{
parent::__construct(
sprintf(
'Matcher with id <%s> is already registered',
$id,
),
);
}
| atcherAlreadyRegisteredException extends \PHPUnit\Fr | {
"filepath": "src/Framework/MockObject/Exception/MatcherAlreadyRegisteredException.php",
"language": "php",
"file_size": 845,
"cut_index": 535,
"middle_length": 52
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @n... | sprintf(
'Parameters for method "%s" are already configured for another matcher. ' .
'with() configures an expectation (the method must be called with the specified arguments), ' .
'it does not select a | */
final class MethodParametersAlreadyConfiguredForAnotherMatcherException extends \PHPUnit\Framework\Exception implements Exception
{
public function __construct(string $methodName)
{
parent::__construct(
| {
"filepath": "src/Framework/MockObject/Exception/MethodParametersAlreadyConfiguredForAnotherMatcherException.php",
"language": "php",
"file_size": 1190,
"cut_index": 518,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
use RuntimeException;
/**
* @no-named-arguments Parameter names are not covered by the backward ... | tion __construct(string $className, string $methodName)
{
parent::__construct(
sprintf(
'Method %s::%s() is declared to never return',
$className,
$methodName,
),
) | non-empty-string $methodName
*/
public func | {
"filepath": "src/Framework/MockObject/Exception/NeverReturningMethodException.php",
"language": "php",
"file_size": 924,
"cut_index": 606,
"middle_length": 52
} |
?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
... | arent::__construct(
sprintf(
'Not enough parameter sets configured, only %d parameter sets given for %s::%s()',
$numberOfConfiguredParameterSets,
$invocation->className(),
$invocat | Unit
*/
final class NoMoreParameterSetsConfiguredException extends \PHPUnit\Framework\Exception implements Exception
{
public function __construct(Invocation $invocation, int $numberOfConfiguredParameterSets)
{
p | {
"filepath": "src/Framework/MockObject/Exception/NoMoreParameterSetsConfiguredException.php",
"language": "php",
"file_size": 1051,
"cut_index": 513,
"middle_length": 229
} |
s=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function class_exists;
use PHPUnit\Fr... | eMethod>
*/
private array $configurableMethods;
/**
* @param class-string $mockName
* @param list<ConfigurableMethod> $configurableMethods
*/
public function __construct(string $classCode, string $mockName, arra | y the backward compatibility promise for PHPUnit
*/
final readonly class DoubledClass
{
private string $classCode;
/**
* @var class-string
*/
private string $mockName;
/**
* @var list<Configurabl | {
"filepath": "src/Framework/MockObject/Generator/DoubledClass.php",
"language": "php",
"file_size": 1691,
"cut_index": 537,
"middle_length": 229
} |
declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function array_key... | ubledMethod ...$methods): void
{
foreach ($methods as $method) {
$this->methods[strtolower($method->methodName())] = $method;
}
}
/**
* @return list<DoubledMethod>
*/
public function asArray(): array
| class is not covered by the backward compatibility promise for PHPUnit
*/
final class DoubledMethodSet
{
/**
* @var array<string,DoubledMethod>
*/
private array $methods = [];
public function addMethods(Do | {
"filepath": "src/Framework/MockObject/Generator/DoubledMethodSet.php",
"language": "php",
"file_size": 1204,
"cut_index": 518,
"middle_length": 229
} |
use Exception;
use Iterator;
use IteratorAggregate;
use PHPUnit\Framework\MockObject\ConfigurableMethod;
use PHPUnit\Framework\MockObject\DoubledCloneMethod;
use PHPUnit\Framework\MockObject\Method;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\MockObjectApi;
use PHPUnit\Framework\MockO... |
use Throwable;
use Traversable;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class Gener | \StubInternal;
use PHPUnit\Framework\MockObject\TestDoubleState;
use PropertyHookType;
use ReflectionClass;
use ReflectionMethod;
use ReflectionObject;
use SebastianBergmann\Type\ReflectionMapper;
use SebastianBergmann\Type\Type; | {
"filepath": "src/Framework/MockObject/Generator/Generator.php",
"language": "php",
"file_size": 28188,
"cut_index": 1331,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function assert;
use PHPUnit\Framework\MockObject\Generator\ClassIsAnonym... | Exception;
use PHPUnit\Framework\MockObject\Generator\ReflectionException;
use PHPUnit\Framework\MockObject\Generator\RuntimeException;
use PHPUnit\Framework\MockObject\Generator\UnknownTypeException;
/**
* @template StubbedType of object
*
* @template | or\DuplicateMethodException;
use PHPUnit\Framework\MockObject\Generator\InvalidClassNameException;
use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException;
use PHPUnit\Framework\MockObject\Generator\NameAlreadyInUse | {
"filepath": "src/Framework/MockObject/TestStubBuilder.php",
"language": "php",
"file_size": 2388,
"cut_index": 563,
"middle_length": 229
} |
ict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @no-named-arg... | Framework\Exception implements Exception
{
public function __construct(string $id)
{
parent::__construct(
sprintf(
'No builder found for match builder identification <%s>',
$id,
),
| lass MatchBuilderNotFoundException extends \PHPUnit\ | {
"filepath": "src/Framework/MockObject/Exception/MatchBuilderNotFoundException.php",
"language": "php",
"file_size": 853,
"cut_index": 529,
"middle_length": 52
} |
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**... | rent::__construct(
sprintf(
'Only %d return values have been configured for %s::%s()',
$numberOfConfiguredReturnValues,
$invocation->className(),
$invocation->methodName(),
| PUnit
*/
final class NoMoreReturnValuesConfiguredException extends \PHPUnit\Framework\Exception implements Exception
{
public function __construct(Invocation $invocation, int $numberOfConfiguredReturnValues)
{
pa | {
"filepath": "src/Framework/MockObject/Exception/NoMoreReturnValuesConfiguredException.php",
"language": "php",
"file_size": 1024,
"cut_index": 512,
"middle_length": 229
} |
n implode;
use function is_object;
use function is_string;
use function preg_match;
use function preg_replace;
use function str_contains;
use function strlen;
use function strpos;
use function substr;
use function substr_count;
use function trim;
use function var_export;
use ReflectionMethod;
use ReflectionParameter;
u... | private readonly string $className;
/**
* @var non-empty-string
*/
private readonly string $methodName;
private readonly string $modifier;
private readonly string $argumentsForDeclaration;
private readonly string $argumentsFo | compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class DoubledMethod
{
use TemplateLoader;
/**
* @var class-string
*/
| {
"filepath": "src/Framework/MockObject/Generator/DoubledMethod.php",
"language": "php",
"file_size": 12060,
"cut_index": 921,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use function sprintf;
/**
* @no-named-arguments Parameter names a... | each ($properties as $property) {
$code .= sprintf(
<<<'EOT'
public %s $%s {
EOT,
$property->type()->asString(),
$property->name(),
);
if ($property->shouldGenerateGe | ator
{
/**
* @param class-string $className
* @param list<HookedProperty> $properties
*/
public function generate(string $className, array $properties): string
{
$code = '';
for | {
"filepath": "src/Framework/MockObject/Generator/HookedPropertyGenerator.php",
"language": "php",
"file_size": 2200,
"cut_index": 563,
"middle_length": 229
} |
n <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise ... | t(string $method)
{
parent::__construct(
sprintf(
'Trying to configure method "%s" which cannot be configured because it does not exist, has not been specified, is final, or is static',
$method,
| mplements Exception
{
public function __construc | {
"filepath": "src/Framework/MockObject/Exception/MethodCannotBeConfiguredException.php",
"language": "php",
"file_size": 943,
"cut_index": 606,
"middle_length": 52
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Generator;
use SebastianBergmann\Type\Type;
/**
* @no-named-arguments Parame... | /**
* @param non-empty-string $name
*/
public function __construct(string $name, Type $type, bool $getHook, bool $setHook, bool $virtual, ?Type $setterType)
{
$this->name = $name;
$this->type = $type;
| HookedProperty
{
/**
* @var non-empty-string
*/
private string $name;
private Type $type;
private bool $getHook;
private bool $setHook;
private bool $virtual;
private ?Type $setterType;
| {
"filepath": "src/Framework/MockObject/Generator/HookedProperty.php",
"language": "php",
"file_size": 2106,
"cut_index": 563,
"middle_length": 229
} |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject;
use function sprintf;
/**
* @no-named-arguments Parameter names are not covered by the backwar... | blic function __construct(Invocation $invocation)
{
parent::__construct(
sprintf(
'No return value is configured for %s::%s() and return value generation is disabled',
$invocation->className(),
| it\Framework\Exception implements Exception
{
pu | {
"filepath": "src/Framework/MockObject/Exception/ReturnValueNotConfiguredException.php",
"language": "php",
"file_size": 961,
"cut_index": 582,
"middle_length": 52
} |
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Stub;
use PHPUnit\Framework\MockObject\Invocation;
use Throwab... | lements Stub
{
private Throwable $exception;
public function __construct(Throwable $exception)
{
$this->exception = $exception;
}
/**
* @throws Throwable
*/
public function invoke(Invocation $invocation): never
| e for PHPUnit
*/
final readonly class Exception imp | {
"filepath": "src/Framework/MockObject/Runtime/Stub/Exception.php",
"language": "php",
"file_size": 900,
"cut_index": 547,
"middle_length": 52
} |
e(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Framework\MockObject\Rule;
use PHPUnit\Framework\Expectation... | once';
}
/**
* Verifies that the current expectation is valid. If everything is OK the
* code should just return, if not it must throw an exception.
*
* @throws ExpectationFailedException
*/
public function verify(): v |
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class InvokedAtLeastOnce extends InvocationOrder
{
public function toString(): string
{
return 'invoked at least | {
"filepath": "src/Framework/MockObject/Runtime/Rule/InvokedAtLeastOnce.php",
"language": "php",
"file_size": 1348,
"cut_index": 524,
"middle_length": 229
} |
art of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI;
use function mt_srand;
use PHPUnit\Event;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Runn... | tion run(Configuration $configuration, ResultCache $resultCache, TestSuite $suite): void
{
try {
Event\Facade::emitter()->testRunnerStarted();
if ($configuration->executionOrder() === TestSuiteSorter::ORDER_RANDOMIZED) | e backward compatibility promise for PHPUnit
*
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class TestRunner
{
/**
* @throws RuntimeException
*/
public func | {
"filepath": "src/TextUI/TestRunner.php",
"language": "php",
"file_size": 2538,
"cut_index": 563,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.