| 148 |
lars |
1 |
<?php declare(strict_types=1);
|
|
|
2 |
/*
|
|
|
3 |
* This file is part of PHPUnit.
|
|
|
4 |
*
|
|
|
5 |
* (c) Sebastian Bergmann <sebastian@phpunit.de>
|
|
|
6 |
*
|
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
|
|
8 |
* file that was distributed with this source code.
|
|
|
9 |
*/
|
|
|
10 |
namespace PHPUnit\Framework\MockObject;
|
|
|
11 |
|
|
|
12 |
use function sprintf;
|
|
|
13 |
|
|
|
14 |
/**
|
|
|
15 |
* @internal This class is not covered by the backward compatibility promise for PHPUnit
|
|
|
16 |
*/
|
|
|
17 |
final class CannotUseOnlyMethodsException extends \PHPUnit\Framework\Exception implements Exception
|
|
|
18 |
{
|
|
|
19 |
public function __construct(string $type, string $methodName)
|
|
|
20 |
{
|
|
|
21 |
parent::__construct(
|
|
|
22 |
sprintf(
|
|
|
23 |
'Trying to configure method "%s" with onlyMethods(), but it does not exist in class "%s". Use addMethods() for methods that do not exist in the class',
|
|
|
24 |
$methodName,
|
|
|
25 |
$type
|
|
|
26 |
)
|
|
|
27 |
);
|
|
|
28 |
}
|
|
|
29 |
}
|