No Description

HhvmExceptionPatchSpec.php 1.1KB

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