comparison vendor/phpspec/prophecy/spec/Prophecy/Exception/Prediction/AggregateExceptionSpec.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace spec\Prophecy\Exception\Prediction;
4
5 use PhpSpec\ObjectBehavior;
6 use Prophecy\Exception\Prediction\PredictionException;
7 use Prophecy\Prophecy\ObjectProphecy;
8
9 class AggregateExceptionSpec extends ObjectBehavior
10 {
11 function let()
12 {
13 $this->beConstructedWith(null);
14 }
15
16 function it_is_prediction_exception()
17 {
18 $this->shouldBeAnInstanceOf('RuntimeException');
19 $this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException');
20 }
21
22 function it_can_store_objectProphecy_link(ObjectProphecy $object)
23 {
24 $this->setObjectProphecy($object);
25 $this->getObjectProphecy()->shouldReturn($object);
26 }
27
28 function it_should_not_have_exceptions_at_the_beginning()
29 {
30 $this->getExceptions()->shouldHaveCount(0);
31 }
32
33 function it_should_append_exception_through_append_method(PredictionException $exception)
34 {
35 $exception->getMessage()->willReturn('Exception #1');
36
37 $this->append($exception);
38
39 $this->getExceptions()->shouldReturn(array($exception));
40 }
41
42 function it_should_update_message_during_append(PredictionException $exception)
43 {
44 $exception->getMessage()->willReturn('Exception #1');
45
46 $this->append($exception);
47
48 $this->getMessage()->shouldReturn(" Exception #1");
49 }
50 }