public function testDoesNotRewriteCustomType()
 {
     $event = $this->createEvent($obj = new SimpleObjectProxy('a', 'b'), array('name' => 'FakedName', 'params' => array()));
     $this->subscriber->onPreSerialize($event);
     $this->assertEquals(array('name' => 'FakedName', 'params' => array()), $event->getType());
     $this->assertTrue($obj->__isInitialized());
 }
示例#2
0
 public function testInitializedDoctrineProxy()
 {
     if (!class_exists('Doctrine\\ORM\\Version')) {
         $this->markTestSkipped('Doctrine is not available.');
     }
     $object = new SimpleObjectProxy('foo', 'bar');
     $object->__load();
     $this->assertEquals($this->getContent('orm_proxy'), $this->serialize($object));
 }