2018-11-25 00:27:52 +01:00
|
|
|
<?php
|
|
|
|
namespace PHPUnit\Framework\MockObject;
|
|
|
|
|
|
|
|
use PHPUnit\Framework\TestCase;
|
2018-12-01 03:50:53 +01:00
|
|
|
use PHPUnit\Framework\MockObject\Builder\InvocationMocker;
|
2020-08-05 01:04:43 +02:00
|
|
|
use PHPUnit\Framework\Constraint\Constraint;
|
2018-11-25 00:27:52 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @template T
|
|
|
|
*/
|
|
|
|
class MockBuilder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @template-typeof T $type
|
2020-08-05 00:53:33 +02:00
|
|
|
* @param TestCase $testCase
|
2018-11-25 00:27:52 +01:00
|
|
|
* @param class-string $type
|
|
|
|
*/
|
|
|
|
public function __construct(TestCase $testCase, $type) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Creates a mock object using a fluent interface.
|
|
|
|
*
|
|
|
|
* @return MockObject&T
|
|
|
|
*/
|
|
|
|
public function getMock() {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the subset of methods to mock. Default is to mock none of them.
|
|
|
|
*
|
|
|
|
* @param array|null $methods
|
|
|
|
*
|
|
|
|
* @return static
|
|
|
|
*/
|
|
|
|
public function setMethods(array $methods = null) {}
|
2018-11-25 07:40:30 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the arguments for the constructor.
|
|
|
|
*
|
|
|
|
* @param array $args
|
|
|
|
*
|
|
|
|
* @return static
|
|
|
|
*/
|
|
|
|
public function setConstructorArgs(array $args) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface MockObject
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param Constraint|string $constraint
|
|
|
|
*
|
2018-12-01 03:50:53 +01:00
|
|
|
* @return InvocationMocker
|
2018-11-25 07:40:30 +01:00
|
|
|
*
|
2021-05-28 12:07:15 +02:00
|
|
|
* @throws \RuntimeException
|
2018-11-25 07:40:30 +01:00
|
|
|
*/
|
|
|
|
public function method($constraint);
|
2018-11-25 00:27:52 +01:00
|
|
|
}
|