コード例 #1
0
 /**
  * Test that postLoad skips non uploadable entity.
  */
 public function testPostLoadSkipsNonUploadable()
 {
     $obj = new DummyEntity();
     $class = new \ReflectionClass($obj);
     $args = $this->getMockBuilder('Doctrine\\Common\\EventArgs')->disableOriginalConstructor()->getMock();
     $this->adapter->expects($this->once())->method('getObjectFromArgs')->will($this->returnValue($obj));
     $this->adapter->expects($this->once())->method('getReflectionClass')->will($this->returnValue($class));
     $this->driver->expects($this->once())->method('readUploadable')->with($class)->will($this->returnValue(null));
     $this->injector->expects($this->never())->method('injectFiles');
     $listener = new UploaderListener($this->adapter, $this->driver, $this->storage, $this->injector);
     $listener->postLoad($args);
 }