Kaynağa Gözat

object wrappers for convinient proxy initialization and insurance, added tests

gediminasm 14 yıl önce
ebeveyn
işleme
b7157196e2

+ 1 - 1
tests/Gedmo/Tool/Logging/DBAL/QueryAnalyzer.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace Tool\Logging\DBAL;
+namespace Gedmo\Tool\Logging\DBAL;
 
 use Doctrine\DBAL\Logging\SQLLogger;
 use Doctrine\DBAL\Types\Type;

+ 180 - 0
lib/Gedmo/Tool/Wrapper/EntityWrapper.php

@@ -0,0 +1,180 @@
+<?php
+
+namespace Gedmo\Tool\Wrapper;
+
+use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\Proxy\Proxy;
+
+/**
+ * Wraps entity or proxy for more convenient
+ * manipulation
+ *
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
+ * @package Gedmo.Tool.Wrapper
+ * @subpackage EntityWrapper
+ * @link http://www.gediminasm.org
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+class EntityWrapper
+{
+    /**
+     * Wrapped Entity
+     *
+     * @var object
+     */
+    protected $entity;
+
+    /**
+     * EntityManager instance
+     *
+     * @var \Doctrine\ORM\EntityManager
+     */
+    protected $em;
+
+    /**
+     * Entity metadata
+     *
+     * @var \Doctrine\ORM\Mapping\ClassMetadata
+     */
+    protected $meta;
+
+    /**
+     * Entity identifier
+     *
+     * @var array
+     */
+    private $identifier = false;
+
+    /**
+     * True if entity or proxy is loaded
+     *
+     * @var boolean
+     */
+    private $initialized = false;
+
+    /**
+     * Wrapp entity
+     *
+     * @param object $entity
+     * @param \Doctrine\ORM\EntityManager $em
+     */
+    public function __construct($entity, EntityManager $em)
+    {
+        $this->em = $em;
+        $this->entity = $entity;
+        $this->meta = $em->getClassMetadata(get_class($this->entity));
+    }
+
+    /**
+     * Get property value
+     *
+     * @param string $property
+     * @return mixed
+     */
+    public function getPropertyValue($property)
+    {
+        $this->initialize();
+        return $this->meta->getReflectionProperty($property)->getValue($this->entity);
+    }
+
+    /**
+     * Populates the entity with given property values
+     *
+     * @param array $data
+     * @return \Gedmo\Tool\Wrapper\EntityWrapper
+     */
+    public function populate(array $data)
+    {
+        foreach ($data as $field => $value) {
+            $this->setPropertyValue($field, $value);
+        }
+        return $this;
+    }
+
+    /**
+     * Set the property
+     *
+     * @param string $property
+     * @param mixed $value
+     * @return \Gedmo\Tool\Wrapper\EntityWrapper
+     */
+    public function setPropertyValue($property, $value)
+    {
+        $this->initialize();
+        $this->meta->getReflectionProperty($property)->setValue($this->entity, $value);
+        return $this;
+    }
+
+    /**
+     * Checks if identifier is valid
+     *
+     * @return boolean
+     */
+    public function hasValidIdentifier()
+    {
+        $result = true;
+        foreach ($this->getIdentifier(false) as $field => $id) {
+            if (!$id) {
+                $result = false;
+                break;
+            }
+        }
+        return $result;
+    }
+
+    /**
+     * Get entity class name
+     *
+     * @return string
+     */
+    public function getClassName()
+    {
+        return $this->meta->name;
+    }
+
+    /**
+     * Get the entity identifier, single or composite
+     *
+     * @param boolean $single
+     * @return array|mixed
+     */
+    public function getIdentifier($single = true)
+    {
+        if (false === $this->identifier) {
+            if ($this->entity instanceof Proxy) {
+                $uow = $this->em->getUnitOfWork();
+                if ($uow->isInIdentityMap($this->entity)) {
+                    $this->identifier = $uow->getEntityIdentifier($this->entity);
+                } else {
+                    $this->initialize();
+                }
+            }
+            if (false === $this->identifier) {
+                $this->identifier = array();
+                foreach ($this->meta->identifier as $name) {
+                    $this->identifier[$name] = $this->getPropertyValue($name);
+                }
+            }
+        }
+        if ($single) {
+            return reset($this->identifier);
+        }
+        return $this->identifier;
+    }
+
+    /**
+     * Initialize the entity if it is proxy
+     * required when is detached or not initialized
+     */
+    protected function initialize()
+    {
+        if (!$this->initialized) {
+            if ($this->entity instanceof Proxy) {
+                $uow = $this->em->getUnitOfWork();
+                if (!$this->entity->__isInitialized__) {
+                    $this->entity->__load();
+                }
+            }
+        }
+    }
+}

+ 178 - 0
lib/Gedmo/Tool/Wrapper/MongoDocumentWrapper.php

@@ -0,0 +1,178 @@
+<?php
+
+namespace Gedmo\Tool\Wrapper;
+
+use Doctrine\ODM\MongoDB\DocumentManager;
+use Doctrine\ODM\MongoDB\Proxy\Proxy;
+
+/**
+ * Wraps document or proxy for more convenient
+ * manipulation
+ *
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
+ * @package Gedmo.Tool.Wrapper
+ * @subpackage MongoDocumentWrapper
+ * @link http://www.gediminasm.org
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+class MongoDocumentWrapper
+{
+    /**
+     * Wrapped Document
+     *
+     * @var object
+     */
+    protected $document;
+
+    /**
+     * DocumentManager instance
+     *
+     * @var \Doctrine\ODM\MongoDB\DocumentManager
+     */
+    protected $dm;
+
+    /**
+     * Document metadata
+     *
+     * @var \Doctrine\ODM\MongoDB\Mapping\ClassMetadata
+     */
+    protected $meta;
+
+    /**
+     * Document identifier
+     *
+     * @var mixed
+     */
+    private $identifier = false;
+
+    /**
+     * True if document or proxy is loaded
+     *
+     * @var boolean
+     */
+    private $initialized = false;
+
+    /**
+     * Wrapp document
+     *
+     * @param object $document
+     * @param \Doctrine\ODM\MongoDB\DocumentManager $dm
+     */
+    public function __construct($document, DocumentManager $dm)
+    {
+        $this->dm = $dm;
+        $this->document = $document;
+        $this->meta = $dm->getClassMetadata(get_class($this->document));
+    }
+
+    /**
+     * Get property value
+     *
+     * @param string $property
+     * @return mixed
+     */
+    public function getPropertyValue($property)
+    {
+        $this->initialize();
+        return $this->meta->getReflectionProperty($property)->getValue($this->document);
+    }
+
+    /**
+     * Populates the document with given property values
+     *
+     * @param array $data
+     * @return \Gedmo\Tool\Wrapper\MongoDocumentWrapper
+     */
+    public function populate(array $data)
+    {
+        foreach ($data as $field => $value) {
+            $this->setPropertyValue($field, $value);
+        }
+        return $this;
+    }
+
+    /**
+     * Set the property
+     *
+     * @param string $property
+     * @param mixed $value
+     * @return \Gedmo\Tool\Wrapper\MongoDocumentWrapper
+     */
+    public function setPropertyValue($property, $value)
+    {
+        $this->initialize();
+        $this->meta->getReflectionProperty($property)->setValue($this->document, $value);
+        return $this;
+    }
+
+    /**
+     * Checks if identifier is valid
+     *
+     * @return boolean
+     */
+    public function hasValidIdentifier()
+    {
+        return (bool)$this->getIdentifier();
+    }
+
+    /**
+     * Get document class name
+     *
+     * @return string
+     */
+    public function getClassName()
+    {
+        return $this->meta->name;
+    }
+
+    /**
+     * Get the document identifier, single or composite
+     *
+     * @param boolean $single
+     * @return array|mixed
+     */
+    public function getIdentifier($single = true)
+    {
+        if (false === $this->identifier) {
+            if ($this->document instanceof Proxy) {
+                $uow = $this->dm->getUnitOfWork();
+                if ($uow->isInIdentityMap($this->document)) {
+                    $this->identifier = (string)$uow->getDocumentIdentifier($this->document);
+                } else {
+                    $this->initialize();
+                }
+            }
+            if (false === $this->identifier) {
+                $this->identifier = (string)$this->getPropertyValue($this->meta->identifier);
+            }
+        }
+        return $this->identifier;
+    }
+
+    /**
+     * Initialize the document if it is proxy
+     * required when is detached or not initialized
+     */
+    protected function initialize()
+    {
+        if (!$this->initialized) {
+            if ($this->document instanceof Proxy) {
+                $uow = $this->dm->getUnitOfWork();
+                if (!$this->document->__isInitialized__) {
+                    $persister = $uow->getDocumentPersister($this->meta->name);
+                    $identifier = null;
+                    if ($uow->isInIdentityMap($this->document)) {
+                        $identifier = $this->getIdentifier();
+                    } else {
+                        // this may not happen but in case
+                        $reflProperty = new \ReflectionProperty($this->document, 'identifier');
+                        $reflProperty->setAccessible(true);
+                        $identifier = $reflProperty->getValue($this->document);
+                    }
+                    $this->document->__isInitialized__ = true;
+                    $persister->load($identifier, $this->document);
+                }
+            }
+        }
+    }
+}

+ 5 - 5
lib/Gedmo/Translatable/Document/Repository/TranslationRepository.php

@@ -5,6 +5,7 @@ namespace Gedmo\Translatable\Document\Repository;
 use Gedmo\Translatable\TranslationListener;
 use Doctrine\ODM\MongoDB\DocumentRepository;
 use Doctrine\ODM\MongoDB\Cursor;
+use Gedmo\Tool\Wrapper\MongoDocumentWrapper;
 
 /**
  * The TranslationRepository has some useful functions
@@ -58,15 +59,14 @@ class TranslationRepository extends DocumentRepository
     public function findTranslations($document)
     {
         $result = array();
-        if ($document) {
-            $meta = $this->dm->getClassMetadata(get_class($document));
-            $identifier = $meta->identifier;
-            $documentId = $meta->getReflectionProperty($identifier)->getValue($document);
+        $wrapped = new MongoDocumentWrapper($document, $this->dm);
+        if ($wrapped->hasValidIdentifier()) {
+            $documentId = $wrapped->getIdentifier();
 
             $translationMeta = $this->getClassMetadata();
             $qb = $this->createQueryBuilder();
             $q = $qb->field('foreignKey')->equals($documentId)
-                ->field('objectClass')->equals($meta->name)
+                ->field('objectClass')->equals($wrapped->getClassName())
                 ->sort('locale', 'asc')
                 ->getQuery();
 

+ 5 - 8
lib/Gedmo/Translatable/Entity/Repository/TranslationRepository.php

@@ -5,6 +5,7 @@ namespace Gedmo\Translatable\Entity\Repository;
 use Gedmo\Translatable\TranslationListener;
 use Doctrine\ORM\EntityRepository;
 use Doctrine\ORM\Query;
+use Gedmo\Tool\Wrapper\EntityWrapper;
 
 /**
  * The TranslationRepository has some useful functions
@@ -57,14 +58,10 @@ class TranslationRepository extends EntityRepository
     public function findTranslations($entity)
     {
         $result = array();
-        if ($entity) {
-            if ($this->_em->getUnitOfWork()->getEntityState($entity) == \Doctrine\ORM\UnitOfWork::STATE_NEW) {
-                return $result;
-            }
-            $meta = $this->_em->getClassMetadata(get_class($entity));
-            $entityClass = $meta->name;
-            $identifier = $meta->getSingleIdentifierFieldName();
-            $entityId = $meta->getReflectionProperty($identifier)->getValue($entity);
+        $wrapped = new EntityWrapper($entity, $this->_em);
+        if ($wrapped->hasValidIdentifier()) {
+            $entityId = $wrapped->getIdentifier();
+            $entityClass = $wrapped->getClassName();
 
             $translationMeta = $this->getClassMetadata(); // table inheritance support
             $qb = $this->_em->createQueryBuilder();

+ 6 - 0
tests/Gedmo/Mapping/TreeMappingTest.php

@@ -71,6 +71,9 @@ class TreeMappingTest extends \PHPUnit_Framework_TestCase
 
     public function testYamlNestedMapping()
     {
+        if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
+            $this->markTestSkipped('APC extension is not loaded.');
+        }
         $meta = $this->em->getClassMetadata(self::TEST_YAML_ENTITY_CLASS);
         $cacheId = ExtensionMetadataFactory::getCacheId(
             self::TEST_YAML_ENTITY_CLASS,
@@ -93,6 +96,9 @@ class TreeMappingTest extends \PHPUnit_Framework_TestCase
 
     public function testYamlClosureMapping()
     {
+        if (!extension_loaded('apc') || !ini_get('apc.enable_cli')) {
+            $this->markTestSkipped('APC extension is not loaded.');
+        }
         $meta = $this->em->getClassMetadata(self::YAML_CLOSURE_CATEGORY);
         $cacheId = ExtensionMetadataFactory::getCacheId(self::YAML_CLOSURE_CATEGORY, 'Gedmo\Tree');
         $config = $this->em->getMetadataFactory()->getCacheDriver()->fetch($cacheId);

+ 1 - 1
tests/Gedmo/Tool/BaseTestCaseORM.php

@@ -2,7 +2,7 @@
 
 namespace Tool;
 
-use Tool\Logging\DBAL\QueryAnalyzer;
+use Gedmo\Tool\Logging\DBAL\QueryAnalyzer;
 use Doctrine\Common\Annotations\AnnotationReader;
 use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
 use Doctrine\ORM\EntityManager;

tests/Gedmo/Translatable/Issue75Test.php → tests/Gedmo/Translatable/Issue/Issue75Test.php


+ 62 - 0
tests/Gedmo/Translatable/Issue/Issue84Test.php

@@ -0,0 +1,62 @@
+<?php
+
+namespace Gedmo\Translatable;
+
+use Doctrine\Common\EventManager;
+use Tool\BaseTestCaseORM;
+use Translatable\Fixture\Article;
+use Doctrine\ORM\Proxy\Proxy;
+
+/**
+ * These are tests for translatable behavior
+ *
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
+ * @package Gedmo.Translatable
+ * @link http://www.gediminasm.org
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+class Issue84Test extends BaseTestCaseORM
+{
+    const ARTICLE = 'Translatable\\Fixture\\Article';
+    const TRANSLATION = 'Gedmo\\Translatable\\Entity\\Translation';
+
+    private $translatableListener;
+
+    protected function setUp()
+    {
+        parent::setUp();
+
+        $evm = new EventManager;
+        $this->translatableListener = new TranslationListener();
+        $this->translatableListener->setTranslatableLocale('en');
+        $evm->addEventSubscriber($this->translatableListener);
+
+        $this->getMockSqliteEntityManager($evm);
+    }
+
+    public function testIssue84()
+    {
+        $repo = $this->em->getRepository(self::TRANSLATION);
+
+        $article = new Article;
+        $article->setTitle('en art');
+        $article->setContent('content');
+        $this->em->persist($article);
+        $this->em->flush();
+        $this->em->clear();
+
+        $article = $this->em->getReference(self::ARTICLE, 1);
+        $this->assertInstanceOf('Doctrine\ORM\Proxy\Proxy', $article);
+
+        $trans = $repo->findTranslations($article);
+        $this->assertEquals(1, count($trans));
+    }
+
+    protected function getUsedEntityFixtures()
+    {
+        return array(
+            self::ARTICLE,
+            self::TRANSLATION
+        );
+    }
+}

+ 103 - 0
tests/Gedmo/Wrapper/EntityWrapperTest.php

@@ -0,0 +1,103 @@
+<?php
+
+namespace Wrapper;
+
+use Tool\BaseTestCaseORM;
+use Doctrine\Common\EventManager;
+use Wrapper\Fixture\Entity\Article;
+use Gedmo\Tool\Wrapper\EntityWrapper;
+
+/**
+ * Entity wrapper tests
+ *
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
+ * @link http://www.gediminasm.org
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+class EntityWrapperTest extends BaseTestCaseORM
+{
+    const ARTICLE = "Wrapper\\Fixture\\Entity\\Article";
+
+    protected function setUp()
+    {
+        parent::setUp();
+        $this->getMockSqliteEntityManager(new EventManager);
+        $this->populate();
+    }
+
+    public function testManaged()
+    {
+        $test = $this->em->find(self::ARTICLE, array('id' => 1));
+        $this->assertInstanceOf(self::ARTICLE, $test);
+        $wrapped = new EntityWrapper($test, $this->em);
+
+        $this->assertEquals(1, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+        $wrapped->setPropertyValue('title', 'changed');
+        $this->assertEquals('changed', $wrapped->getPropertyValue('title'));
+
+        $this->assertTrue($wrapped->hasValidIdentifier());
+    }
+
+    public function testProxy()
+    {
+        $this->em->clear();
+        $test = $this->em->getReference(self::ARTICLE, array('id' => 1));
+        $this->assertInstanceOf('Doctrine\\ORM\\Proxy\\Proxy', $test);
+        $wrapped = new EntityWrapper($test, $this->em);
+
+        $id = $wrapped->getIdentifier(false);
+        $this->assertTrue(is_array($id));
+        $this->assertEquals(1, count($id));
+        $this->assertArrayHasKey('id', $id);
+        $this->assertEquals(1, $id['id']);
+
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testDetachedEntity()
+    {
+        $test = $this->em->find(self::ARTICLE, array('id' => 1));
+        $this->em->clear();
+        $wrapped = new EntityWrapper($test, $this->em);
+
+        $this->assertEquals(1, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testDetachedProxy()
+    {
+        $test = $this->em->getReference(self::ARTICLE, array('id' => 1));
+        $this->em->clear();
+        $wrapped = new EntityWrapper($test, $this->em);
+
+        $this->assertEquals(1, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testSomeFunctions()
+    {
+        $test = new Article;
+        $wrapped = new EntityWrapper($test, $this->em);
+
+        $wrapped->populate(array('title' => 'test'));
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+
+        $this->assertFalse($wrapped->hasValidIdentifier());
+    }
+
+    protected function getUsedEntityFixtures()
+    {
+        return array(
+            self::ARTICLE
+        );
+    }
+
+    private function populate()
+    {
+        $test = new Article;
+        $test->setTitle("test");
+        $this->em->persist($test);
+        $this->em->flush();
+    }
+}

+ 32 - 0
tests/Gedmo/Wrapper/Fixture/Document/Article.php

@@ -0,0 +1,32 @@
+<?php
+
+namespace Wrapper\Fixture\Document;
+
+/**
+ * @Document(collection="articles")
+ */
+class Article
+{
+    /** @Id */
+    private $id;
+
+    /**
+     * @String
+     */
+    private $title;
+
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    public function getTitle()
+    {
+        return $this->title;
+    }
+}

+ 36 - 0
tests/Gedmo/Wrapper/Fixture/Entity/Article.php

@@ -0,0 +1,36 @@
+<?php
+
+namespace Wrapper\Fixture\Entity;
+
+/**
+ * @Entity
+ */
+class Article
+{
+    /**
+     * @Id
+     * @GeneratedValue
+     * @Column(type="integer")
+     */
+    private $id;
+
+    /**
+     * @Column(length=128)
+     */
+    private $title;
+
+    public function getId()
+    {
+        return $this->id;
+    }
+
+    public function setTitle($title)
+    {
+        $this->title = $title;
+    }
+
+    public function getTitle()
+    {
+        return $this->title;
+    }
+}

+ 95 - 0
tests/Gedmo/Wrapper/MongoDocumentWrapperTest.php

@@ -0,0 +1,95 @@
+<?php
+
+namespace Wrapper;
+
+use Tool\BaseTestCaseMongoODM;
+use Doctrine\Common\EventManager;
+use Wrapper\Fixture\Document\Article;
+use Gedmo\Tool\Wrapper\MongoDocumentWrapper;
+
+/**
+ * Mongo Document wrapper tests
+ *
+ * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
+ * @link http://www.gediminasm.org
+ * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
+ */
+class MongoDocumentWrapperTest extends BaseTestCaseMongoODM
+{
+    const ARTICLE = "Wrapper\\Fixture\\Document\\Article";
+    private $articleId;
+
+    protected function setUp()
+    {
+        parent::setUp();
+        $this->getMockDocumentManager(new EventManager);
+        $this->populate();
+    }
+
+    public function testManaged()
+    {
+        $test = $this->dm->find(self::ARTICLE, $this->articleId);
+        $this->assertInstanceOf(self::ARTICLE, $test);
+        $wrapped = new MongoDocumentWrapper($test, $this->dm);
+
+        $this->assertEquals($this->articleId, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+        $wrapped->setPropertyValue('title', 'changed');
+        $this->assertEquals('changed', $wrapped->getPropertyValue('title'));
+
+        $this->assertTrue($wrapped->hasValidIdentifier());
+    }
+
+    public function testProxy()
+    {
+        $this->dm->clear();
+        $test = $this->dm->getReference(self::ARTICLE, $this->articleId);
+        $this->assertInstanceOf('Doctrine\\ODM\\MongoDB\\Proxy\\Proxy', $test);
+        $wrapped = new MongoDocumentWrapper($test, $this->dm);
+
+        $id = $wrapped->getIdentifier(false);
+        $this->assertEquals($this->articleId, $id);
+
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testDetachedEntity()
+    {
+        $test = $this->dm->find(self::ARTICLE, $this->articleId);
+        $this->dm->clear();
+        $wrapped = new MongoDocumentWrapper($test, $this->dm);
+
+        $this->assertEquals($this->articleId, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testDetachedProxy()
+    {
+        $test = $this->dm->getReference(self::ARTICLE, $this->articleId);
+        $this->dm->clear();
+        $wrapped = new MongoDocumentWrapper($test, $this->dm);
+
+        $this->assertEquals($this->articleId, $wrapped->getIdentifier());
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+    }
+
+    public function testSomeFunctions()
+    {
+        $test = new Article;
+        $wrapped = new MongoDocumentWrapper($test, $this->dm);
+
+        $wrapped->populate(array('title' => 'test'));
+        $this->assertEquals('test', $wrapped->getPropertyValue('title'));
+
+        $this->assertFalse($wrapped->hasValidIdentifier());
+    }
+
+    private function populate()
+    {
+        $test = new Article;
+        $test->setTitle("test");
+        $this->dm->persist($test);
+        $this->dm->flush();
+        $this->articleId = $test->getId();
+    }
+}

+ 1 - 0
tests/bootstrap.php

@@ -46,6 +46,7 @@ $loader->registerNamespaces(array(
     'Sluggable\\Fixture'         => __DIR__.'/Gedmo',
     'Mapping\\Fixture'           => __DIR__.'/Gedmo',
     'Loggable\\Fixture'          => __DIR__.'/Gedmo',
+    'Wrapper\\Fixture'           => __DIR__.'/Gedmo',
 ));
 $loader->register();
 

+ 3 - 0
tests/phpunit.xml.dist

@@ -19,5 +19,8 @@
         <testsuite name="Loggable Extension">
             <directory suffix=".php">./Gedmo/Loggable/</directory>
         </testsuite>
+        <testsuite name="Object wrappers">
+            <directory suffix=".php">./Gedmo/Wrapper/</directory>
+        </testsuite>
     </testsuites>
 </phpunit>