/**
  * @param \stdClass $object
  */
 function it_wraps_non_token_arguments_into_ExactValueToken($object)
 {
     $this->beConstructedWith(array(42, 'zet', $object));
     $class = get_class($object->getWrappedObject());
     $hash = spl_object_hash($object->getWrappedObject());
     $this->__toString()->shouldReturn("exact(42), exact(\"zet\"), exact({$class}:{$hash} Object (\n    'objectProphecy' => Prophecy\\Prophecy\\ObjectProphecy Object (*Prophecy*)\n))");
 }
 /**
  * @param \stdClass $object
  */
 function it_generates_proper_string_representation_for_object($object)
 {
     $objHash = sprintf('%s:%s', get_class($object->getWrappedObject()), spl_object_hash($object->getWrappedObject()));
     $this->beConstructedWith($object);
     $this->__toString()->shouldReturn("exact({$objHash} Object (\n    'objectProphecy' => Prophecy\\Prophecy\\ObjectProphecy Object (*Prophecy*)\n))");
 }
Esempio n. 3
0
 /**
  * @param stdClass $object
  */
 function it_generates_proper_string_representation_for_object_without_exporting($object)
 {
     $objHash = sprintf('%s:%s', get_class($object->getWrappedObject()), spl_object_hash($object->getWrappedObject()));
     $this->stringify($object, FALSE)->shouldReturn("{$objHash}");
 }
Esempio n. 4
0
 /**
  * @param \BjyAuthorize\Service\Authorize $authorizeService
  * @param \stdClass                       $entity
  */
 public function it_should_use_classname_if_entity_is_no_ResourceInterface($authorizeService, $entity)
 {
     $authorizeService->isAllowed(Argument::cetera())->willReturn(true);
     $this->mockListenerFactory($authorizeService->getWrappedObject());
     $className = get_class($entity->getWrappedObject());
     $permission = 'permission';
     $this->isAllowed($entity, $permission);
     $authorizeService->isAllowed($className, $permission)->shouldBeCalled();
 }