public function setUp()
 {
     parent::setUp();
     Validator::$enableMimeTypesConfigException = false;
     $reader = new AnnotationReader();
     $annotationDriver = new AnnotationDriver($reader);
     $xmlDriver = new XmlDriver(__DIR__ . '/../Driver/Xml');
     $chain = new DriverChain();
     $chain->addDriver($xmlDriver, 'Mapping\\Fixture\\Xml');
     $chain->addDriver($annotationDriver, 'Mapping\\Fixture');
     $this->listener = new UploadableListener();
     $this->evm = new EventManager();
     $this->evm->addEventSubscriber($this->listener);
     $this->em = $this->getMockSqliteEntityManager(array('Mapping\\Fixture\\Xml\\Uploadable'), $chain);
 }
Ejemplo n.º 2
0
 /**
  * @expectedException Gedmo\Exception\InvalidMappingException
  */
 public function test_validateConfiguration_ifAllowedTypesAndDisallowedTypesAreSetThenThrowException()
 {
     $this->meta->expects($this->once())->method('getReflectionClass')->will($this->returnValue(new \ReflectionClass(new FakeEntity())));
     Validator::$enableMimeTypesConfigException = true;
     $config = array('fileMimeTypeField' => 'someField', 'filePathField' => 'someField', 'fileSizeField' => '', 'pathMethod' => '', 'callback' => '', 'maxSize' => 0, 'allowedTypes' => 'text/plain', 'disallowedTypes' => 'text/css');
     Validator::validateConfiguration($this->meta, $config);
 }