HhvmExceptionPatchSpec.php 1020 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace spec\Prophecy\Doubler\ClassPatch;
  3. use PhpSpec\ObjectBehavior;
  4. use Prophecy\Argument;
  5. use Prophecy\Doubler\Generator\Node\ClassNode;
  6. use Prophecy\Doubler\Generator\Node\MethodNode;
  7. class HhvmExceptionPatchSpec extends ObjectBehavior
  8. {
  9. function it_is_a_patch()
  10. {
  11. $this->shouldBeAnInstanceOf('Prophecy\Doubler\ClassPatch\ClassPatchInterface');
  12. }
  13. function its_priority_is_minus_50()
  14. {
  15. $this->getPriority()->shouldReturn(-50);
  16. }
  17. function it_uses_parent_code_for_setTraceOptions(ClassNode $node, MethodNode $method, MethodNode $getterMethod)
  18. {
  19. $node->hasMethod('setTraceOptions')->willReturn(true);
  20. $node->getMethod('setTraceOptions')->willReturn($method);
  21. $node->hasMethod('getTraceOptions')->willReturn(true);
  22. $node->getMethod('getTraceOptions')->willReturn($getterMethod);
  23. $method->useParentCode()->shouldBeCalled();
  24. $getterMethod->useParentCode()->shouldBeCalled();
  25. $this->apply($node);
  26. }
  27. }