🤩 File Manager - Mr.X
PHP:
8.3.33
Server:
Apache
OS:
Linux 5.14.0-611.49.1.el9_7.x86_64
User:
websparkit
Navigate
Upload:
Upload
New File
New Folder
Editing:TestStubBuilder.php
<?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 assert; use PHPUnit\Framework\MockObject\Generator\ClassIsAnonymousException; use PHPUnit\Framework\MockObject\Generator\ClassIsEnumerationException; use PHPUnit\Framework\MockObject\Generator\ClassIsFinalException; use PHPUnit\Framework\MockObject\Generator\DuplicateMethodException; use PHPUnit\Framework\MockObject\Generator\InvalidClassNameException; use PHPUnit\Framework\MockObject\Generator\InvalidMethodNameException; use PHPUnit\Framework\MockObject\Generator\NameAlreadyInUseException; use PHPUnit\Framework\MockObject\Generator\ReflectionException; use PHPUnit\Framework\MockObject\Generator\RuntimeException; use PHPUnit\Framework\MockObject\Generator\UnknownTypeException; /** * @template StubbedType * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestStubBuilder extends TestDoubleBuilder { /** * @var ?class-string */ private ?string $stubClassName = null; /** * Creates a test stub using a fluent interface. * * @throws ClassIsAnonymousException * @throws ClassIsEnumerationException * @throws ClassIsFinalException * @throws DuplicateMethodException * @throws InvalidClassNameException * @throws InvalidMethodNameException * @throws NameAlreadyInUseException * @throws ReflectionException * @throws RuntimeException * @throws UnknownTypeException * * @return Stub&StubbedType */ public function getStub(): Stub { $object = $this->getTestDouble($this->stubClassName, false); assert($object instanceof $this->type); assert($object instanceof Stub); assert(!$object instanceof MockObject); return $object; } /** * Specifies the name for the mock class. * * @param class-string $name * * @return $this */ public function setStubClassName(string $name): self { $this->stubClassName = $name; return $this; } }
Save Changes
Cancel
Create New File
Create New Folder