From 5b10b7098fcbbab2b6d9f945b875422834a88cb7 Mon Sep 17 00:00:00 2001 From: beberlei Date: Fri, 2 Apr 2010 15:05:53 +0000 Subject: [PATCH] [2.0] DDC-484 - Fix reference to Doctrine\ORM\ORMException in ProxyException, added two unit-tests for missing tests of ProxyException throws --- lib/Doctrine/ORM/Proxy/ProxyException.php | 30 ++++++++++++++++++- .../ORM/Proxy/ProxyClassGeneratorTest.php | 12 ++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Proxy/ProxyException.php b/lib/Doctrine/ORM/Proxy/ProxyException.php index 0531f2fb0..892dbebbb 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyException.php +++ b/lib/Doctrine/ORM/Proxy/ProxyException.php @@ -1,8 +1,36 @@ . +*/ namespace Doctrine\ORM\Proxy; -class ProxyException extends Doctrine\ORM\ORMException { +/** + * ORM Proxy Exception + * + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.doctrine-project.com + * @since 1.0 + * @version $Revision$ + * @author Benjamin Eberlei + */ +class ProxyException extends \Doctrine\ORM\ORMException { public static function proxyDirectoryRequired() { return new self("You must configure a proxy directory. See docs for details"); diff --git a/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php b/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php index c0e8ac601..9445af133 100644 --- a/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Proxy/ProxyClassGeneratorTest.php @@ -141,6 +141,18 @@ class ProxyClassGeneratorTest extends \Doctrine\Tests\OrmTestCase $this->assertEquals(1, substr_count($classCode, 'function __sleep')); } + + public function testNoConfigDir_ThrowsException() + { + $this->setExpectedException('Doctrine\ORM\Proxy\ProxyException'); + new ProxyFactory($this->_getTestEntityManager(), null, null); + } + + public function testNoNamespace_ThrowsException() + { + $this->setExpectedException('Doctrine\ORM\Proxy\ProxyException'); + new ProxyFactory($this->_getTestEntityManager(), __DIR__ . '/generated', null); + } protected function _getMockPersister() {