src/Mock/MockFactory.php
public function createPartialMock(
        ReflectionClass $class,
        $arguments = []
    ): Mock {
        $mock = $class->newInstanceWithoutConstructor();
        $handle = $this->handleFactory
            ->instanceHandle($mock, strval($this->labelSequencer->next()));
        $handle->partial();

        if (null !== $arguments) {
            $handle->constructWith($arguments);
        }

        return $mock;
    }
public function createPartialMock(
        ReflectionClass $class,
        $arguments = []
    ): Mock {
        $mock = $class->newInstanceWithoutConstructor();
        $handle = $this->handleFactory
            ->instanceHandle($mock, strval($this->labelSequencer->next()));
        $handle->partial();

        if (null !== $arguments) {
            $handle->constructWith($arguments);
        }

        return $mock;
    }
public function createPartialMock ( ReflectionClass $ class , $ arguments = [ ] ) : Mock { $ mock = $ class -> newInstanceWithoutConstructor ( ) ; $ handle = $ this -> handleFactory -> instanceHandle ( $ mock , strval ( $ this -> labelSequencer -> next ( ) ) ) ; $ handle -> partial ( ) ; if ( null !== $ arguments ) { $ handle -> constructWith ( $ arguments ) ; } return $ mock ; }
Create a new partial mock instance for the supplied definition.

@param ReflectionClass      $class     The class.
@param Arguments|array|null $arguments The constructor arguments, or null to bypass the constructor.

@return Mock          The newly created mock.
@throws MockException If the mock generation fails.
Create a new partial mock instance for the supplied definition .