From c62abc99c41d19ba15a028ce7c9e73b275965f85 Mon Sep 17 00:00:00 2001 From: meus Date: Thu, 14 Feb 2008 21:14:47 +0000 Subject: [PATCH] added a stub to test the methods that throw exceptions in order to get 100% coverage --- tests/Orm/Component/AccessTest.php | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/Orm/Component/AccessTest.php b/tests/Orm/Component/AccessTest.php index ce2a54e82..d793a2d4a 100644 --- a/tests/Orm/Component/AccessTest.php +++ b/tests/Orm/Component/AccessTest.php @@ -147,4 +147,45 @@ class Orm_Component_AccessTest extends Doctrine_OrmTestCase } + /** + * @test + * @expectedException Doctrine_Exception + */ + public function shouldNotBeAbleToUseContainsWhenNotImplemented() + { + $stub = new AccessStub(); + isset($stub['foo']); + } + + /** + * @test + * @expectedException Doctrine_Exception + */ + public function shouldNotBeAbleToUseSetWhenNotImplemented() + { + $stub = new AccessStub(); + $stub['foo'] = 'foo'; + } + + /** + * @test + * @expectedException Doctrine_Exception + */ + public function shouldNotBeAbleToUseUnsetWhenNotImplemented() + { + $stub = new AccessStub(); + unset($stub['foo']); + } + + /** + * @test + * @expectedException Doctrine_Exception + */ + public function shouldNotBeAbleToUseGetWhenNotImplemented() + { + $stub = new AccessStub(); + $stub['foo']; + } } + +class AccessStub extends Doctrine_Access {}