Mercurial > hg > isophonics-drupal-site
annotate vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php @ 1:1a348b17ec81
Logo and header background
author | Chris Cannam |
---|---|
date | Thu, 30 Nov 2017 14:56:35 +0000 |
parents | 4c8ae668cc8c |
children |
rev | line source |
---|---|
Chris@0 | 1 <?php |
Chris@0 | 2 |
Chris@0 | 3 namespace spec\Prophecy\Exception\Prediction; |
Chris@0 | 4 |
Chris@0 | 5 use PhpSpec\ObjectBehavior; |
Chris@0 | 6 use Prophecy\Exception\Prediction\PredictionException; |
Chris@0 | 7 use Prophecy\Prophecy\ObjectProphecy; |
Chris@0 | 8 |
Chris@0 | 9 class AggregateExceptionSpec extends ObjectBehavior |
Chris@0 | 10 { |
Chris@0 | 11 function let() |
Chris@0 | 12 { |
Chris@0 | 13 $this->beConstructedWith(null); |
Chris@0 | 14 } |
Chris@0 | 15 |
Chris@0 | 16 function it_is_prediction_exception() |
Chris@0 | 17 { |
Chris@0 | 18 $this->shouldBeAnInstanceOf('RuntimeException'); |
Chris@0 | 19 $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException'); |
Chris@0 | 20 } |
Chris@0 | 21 |
Chris@0 | 22 function it_can_store_objectProphecy_link(ObjectProphecy $object) |
Chris@0 | 23 { |
Chris@0 | 24 $this->setObjectProphecy($object); |
Chris@0 | 25 $this->getObjectProphecy()->shouldReturn($object); |
Chris@0 | 26 } |
Chris@0 | 27 |
Chris@0 | 28 function it_should_not_have_exceptions_at_the_beginning() |
Chris@0 | 29 { |
Chris@0 | 30 $this->getExceptions()->shouldHaveCount(0); |
Chris@0 | 31 } |
Chris@0 | 32 |
Chris@0 | 33 function it_should_append_exception_through_append_method(PredictionException $exception) |
Chris@0 | 34 { |
Chris@0 | 35 $exception->getMessage()->willReturn('Exception #1'); |
Chris@0 | 36 |
Chris@0 | 37 $this->append($exception); |
Chris@0 | 38 |
Chris@0 | 39 $this->getExceptions()->shouldReturn(array($exception)); |
Chris@0 | 40 } |
Chris@0 | 41 |
Chris@0 | 42 function it_should_update_message_during_append(PredictionException $exception) |
Chris@0 | 43 { |
Chris@0 | 44 $exception->getMessage()->willReturn('Exception #1'); |
Chris@0 | 45 |
Chris@0 | 46 $this->append($exception); |
Chris@0 | 47 |
Chris@0 | 48 $this->getMessage()->shouldReturn(" Exception #1"); |
Chris@0 | 49 } |
Chris@0 | 50 } |