Update v1.0.6
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Call;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy\Prophecy;
|
||||
|
||||
class UnexpectedCallExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
*/
|
||||
function let($objectProphecy)
|
||||
{
|
||||
$this->beConstructedWith('msg', $objectProphecy, 'getName', array('arg1', 'arg2'));
|
||||
}
|
||||
|
||||
function it_is_prophecy_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
|
||||
}
|
||||
|
||||
function it_exposes_method_name_through_getter()
|
||||
{
|
||||
$this->getMethodName()->shouldReturn('getName');
|
||||
}
|
||||
|
||||
function it_exposes_arguments_through_getter()
|
||||
{
|
||||
$this->getArguments()->shouldReturn(array('arg1', 'arg2'));
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class ClassCreatorExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Doubler\Generator\Node\ClassNode $node
|
||||
*/
|
||||
function let($node)
|
||||
{
|
||||
$this->beConstructedWith('', $node);
|
||||
}
|
||||
|
||||
function it_is_a_prophecy_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
|
||||
}
|
||||
|
||||
function it_contains_a_reflected_node($node)
|
||||
{
|
||||
$this->getClassNode()->shouldReturn($node);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class ClassMirrorExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \ReflectionClass $class
|
||||
*/
|
||||
function let($class)
|
||||
{
|
||||
$this->beConstructedWith('', $class);
|
||||
}
|
||||
|
||||
function it_is_a_prophecy_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
|
||||
}
|
||||
|
||||
function it_contains_a_reflected_class_link($class)
|
||||
{
|
||||
$this->getReflectedClass()->shouldReturn($class);
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class ClassNotFoundExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith('msg', 'CustomClass');
|
||||
}
|
||||
|
||||
function it_is_a_prophecy_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Exception');
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoubleException');
|
||||
}
|
||||
|
||||
function its_getClassname_returns_classname()
|
||||
{
|
||||
$this->getClassname()->shouldReturn('CustomClass');
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class DoubleExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
function it_is_a_double_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('RuntimeException');
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\DoublerException');
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class InterfaceNotFoundExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith('msg', 'CustomInterface');
|
||||
}
|
||||
|
||||
function it_extends_ClassNotFoundException()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Doubler\ClassNotFoundException');
|
||||
}
|
||||
|
||||
function its_getClassname_returns_classname()
|
||||
{
|
||||
$this->getClassname()->shouldReturn('CustomInterface');
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Doubler;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class MethodNotFoundExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith('', 'User', 'getName', array(1, 2, 3));
|
||||
}
|
||||
|
||||
function it_is_DoubleException()
|
||||
{
|
||||
$this->shouldHaveType('Prophecy\Exception\Doubler\DoubleException');
|
||||
}
|
||||
|
||||
function it_has_MethodName()
|
||||
{
|
||||
$this->getMethodName()->shouldReturn('getName');
|
||||
}
|
||||
|
||||
function it_has_classnamej()
|
||||
{
|
||||
$this->getClassname()->shouldReturn('User');
|
||||
}
|
||||
|
||||
function it_has_an_arguments_list()
|
||||
{
|
||||
$this->getArguments()->shouldReturn(array(1, 2, 3));
|
||||
}
|
||||
|
||||
function it_has_a_default_null_argument_list()
|
||||
{
|
||||
$this->beConstructedWith('', 'User', 'getName');
|
||||
$this->getArguments()->shouldReturn(null);
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prediction;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class AggregateExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
function let()
|
||||
{
|
||||
$this->beConstructedWith(null);
|
||||
}
|
||||
|
||||
function it_is_prediction_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('RuntimeException');
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\PredictionException');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $object
|
||||
*/
|
||||
function it_can_store_objectProphecy_link($object)
|
||||
{
|
||||
$this->setObjectProphecy($object);
|
||||
$this->getObjectProphecy()->shouldReturn($object);
|
||||
}
|
||||
|
||||
function it_should_not_have_exceptions_at_the_beginning()
|
||||
{
|
||||
$this->getExceptions()->shouldHaveCount(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Prophecy\Exception\Prediction\PredictionException $exception
|
||||
*/
|
||||
function it_should_append_exception_through_append_method($exception)
|
||||
{
|
||||
$exception->getMessage()->willReturn('Exception #1');
|
||||
|
||||
$this->append($exception);
|
||||
|
||||
$this->getExceptions()->shouldReturn(array($exception));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Prophecy\Exception\Prediction\PredictionException $exception
|
||||
*/
|
||||
function it_should_update_message_during_append($exception)
|
||||
{
|
||||
$exception->getMessage()->willReturn('Exception #1');
|
||||
|
||||
$this->append($exception);
|
||||
|
||||
$this->getMessage()->shouldReturn(" Exception #1");
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prediction;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class NoCallsExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
* @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
|
||||
*/
|
||||
function let($objectProphecy, $methodProphecy)
|
||||
{
|
||||
$methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
|
||||
|
||||
$this->beConstructedWith('message', $methodProphecy);
|
||||
}
|
||||
|
||||
function it_is_PredictionException()
|
||||
{
|
||||
$this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
|
||||
}
|
||||
|
||||
function it_extends_MethodProphecyException()
|
||||
{
|
||||
$this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prediction;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class UnexpectedCallsCountExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
* @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
|
||||
* @param \Prophecy\Call\Call $call1
|
||||
* @param \Prophecy\Call\Call $call2
|
||||
*/
|
||||
function let($objectProphecy, $methodProphecy, $call1, $call2)
|
||||
{
|
||||
$methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
|
||||
|
||||
$this->beConstructedWith('message', $methodProphecy, 5, array($call1, $call2));
|
||||
}
|
||||
|
||||
function it_extends_UnexpectedCallsException()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Prediction\UnexpectedCallsException');
|
||||
}
|
||||
|
||||
function it_should_expose_expectedCount_through_getter()
|
||||
{
|
||||
$this->getExpectedCount()->shouldReturn(5);
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prediction;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
|
||||
class UnexpectedCallsExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
* @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
|
||||
* @param \Prophecy\Call\Call $call1
|
||||
* @param \Prophecy\Call\Call $call2
|
||||
*/
|
||||
function let($objectProphecy, $methodProphecy, $call1, $call2)
|
||||
{
|
||||
$methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
|
||||
|
||||
$this->beConstructedWith('message', $methodProphecy, array($call1, $call2));
|
||||
}
|
||||
|
||||
function it_is_PredictionException()
|
||||
{
|
||||
$this->shouldHaveType('Prophecy\Exception\Prediction\PredictionException');
|
||||
}
|
||||
|
||||
function it_extends_MethodProphecyException()
|
||||
{
|
||||
$this->shouldHaveType('Prophecy\Exception\Prophecy\MethodProphecyException');
|
||||
}
|
||||
|
||||
function it_should_expose_calls_list_through_getter($call1, $call2)
|
||||
{
|
||||
$this->getCalls()->shouldReturn(array($call1, $call2));
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class MethodProphecyExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
* @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
|
||||
*/
|
||||
function let($objectProphecy, $methodProphecy)
|
||||
{
|
||||
$methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
|
||||
|
||||
$this->beConstructedWith('message', $methodProphecy);
|
||||
}
|
||||
|
||||
function it_extends_DoubleException()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ObjectProphecyException');
|
||||
}
|
||||
|
||||
function it_holds_a_stub_reference($methodProphecy)
|
||||
{
|
||||
$this->getMethodProphecy()->shouldReturn($methodProphecy);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
use PhpSpec\ObjectBehavior;
|
||||
use spec\Prophecy\Exception\Prophecy;
|
||||
|
||||
class ObjectProphecyExceptionSpec extends ObjectBehavior
|
||||
{
|
||||
/**
|
||||
* @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
|
||||
*/
|
||||
function let($objectProphecy)
|
||||
{
|
||||
$this->beConstructedWith('message', $objectProphecy);
|
||||
}
|
||||
|
||||
function it_should_be_a_prophecy_exception()
|
||||
{
|
||||
$this->shouldBeAnInstanceOf('Prophecy\Exception\Prophecy\ProphecyException');
|
||||
}
|
||||
|
||||
function it_holds_double_reference($objectProphecy)
|
||||
{
|
||||
$this->getObjectProphecy()->shouldReturn($objectProphecy);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user