You are here

function ClassMirrorSpec::it_ignores_virtually_private_methods in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php \spec\Prophecy\Doubler\Generator\ClassMirrorSpec::it_ignores_virtually_private_methods()

Parameters

ReflectionClass $class:

ReflectionMethod $method1:

ReflectionMethod $method2:

ReflectionMethod $method3:

File

vendor/phpspec/prophecy/spec/Prophecy/Doubler/Generator/ClassMirrorSpec.php, line 493

Class

ClassMirrorSpec

Namespace

spec\Prophecy\Doubler\Generator

Code

function it_ignores_virtually_private_methods($class, $method1, $method2, $method3) {
  $class
    ->getName()
    ->willReturn('SomeClass');
  $class
    ->isInterface()
    ->willReturn(false);
  $class
    ->isFinal()
    ->willReturn(false);
  $class
    ->getMethods(ReflectionMethod::IS_ABSTRACT)
    ->willReturn(array());
  $class
    ->getMethods(ReflectionMethod::IS_PUBLIC)
    ->willReturn(array(
    $method1,
    $method2,
    $method3,
  ));
  $method1
    ->getName()
    ->willReturn('_getName');
  $method2
    ->getName()
    ->willReturn('__toString');
  $method3
    ->getName()
    ->willReturn('isAbstract');
  $method1
    ->isFinal()
    ->willReturn(false);
  $method2
    ->isFinal()
    ->willReturn(false);
  $method3
    ->isFinal()
    ->willReturn(false);
  $method1
    ->isProtected()
    ->willReturn(false);
  $method2
    ->isProtected()
    ->willReturn(false);
  $method3
    ->isProtected()
    ->willReturn(false);
  $method1
    ->isStatic()
    ->willReturn(false);
  $method2
    ->isStatic()
    ->willReturn(false);
  $method3
    ->isStatic()
    ->willReturn(false);
  $method1
    ->returnsReference()
    ->willReturn(false);
  $method2
    ->returnsReference()
    ->willReturn(false);
  $method3
    ->returnsReference()
    ->willReturn(false);
  $method1
    ->getParameters()
    ->willReturn(array());
  $method2
    ->getParameters()
    ->willReturn(array());
  $method3
    ->getParameters()
    ->willReturn(array());
  if (version_compare(PHP_VERSION, '7.0', '>=')) {
    $method1
      ->hasReturnType()
      ->willReturn(false);
    $method2
      ->hasReturnType()
      ->willReturn(false);
    $method3
      ->hasReturnType()
      ->willReturn(false);
  }
  $classNode = $this
    ->reflect($class, array());
  $methodNodes = $classNode
    ->getMethods();
  $methodNodes
    ->shouldHaveCount(2);
  $classNode
    ->hasMethod('isAbstract')
    ->shouldReturn(true);
}