Fixed unit test (phpunit doesn\'t allow to expect the base Exception class)

This commit is contained in:
William DURAND 2011-12-20 17:46:36 +01:00
parent 55187d23bf
commit 19ae10ae27

View file

@ -24,7 +24,7 @@ class InvalidObjectPersister extends ObjectPersister
{
protected function transformToElasticaDocument($object)
{
throw new \Exception('Invalid transformation');
throw new \BadMethodCallException('Invalid transformation');
}
}
@ -57,7 +57,7 @@ class ObjectPersisterTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Exception
* @expectedException \BadMethodCallException
*/
public function testThatErrorIsHandledWhenCannotReplaceObject()
{
@ -96,7 +96,7 @@ class ObjectPersisterTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Exception
* @expectedException \BadMethodCallException
*/
public function testThatErrorIsHandledWhenCannotInsertObject()
{
@ -135,7 +135,7 @@ class ObjectPersisterTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Exception
* @expectedException \BadMethodCallException
*/
public function testThatErrorIsHandledWhenCannotDeleteObject()
{
@ -176,7 +176,7 @@ class ObjectPersisterTest extends \PHPUnit_Framework_TestCase
}
/**
* @expectedException Exception
* @expectedException \BadMethodCallException
*/
public function testThatErrorIsHandledWhenCannotInsertManyObject()
{