Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ParametersMatch.php

function ParametersMatch::with

Sets the parameters to match for, each parameter to this function will be part of match. To perform specific matches or constraints create a new PHPUnit\Framework\Constraint\Constraint and use it for the parameter. If the parameter value is not a constraint it will use the PHPUnit\Framework\Constraint\IsEqual for the value.

Some examples: <code> // match first parameter with value 2 $b->with(2); // match first parameter with value 'smock' and second identical to 42 $b->with('smock', new PHPUnit\Framework\Constraint\IsEqual(42)); </code>

1 method overrides ParametersMatch::with()
InvocationMocker::with in vendor/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/InvocationMocker.php

File

vendor/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/ParametersMatch.php, line 39

Class

ParametersMatch
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework\MockObject\Builder

Code

public function with(mixed ...$arguments) : self;

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal