public function testNameReturnsAnUniqueName() { $file = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\File\\File')->disableOriginalConstructor()->getMock(); $file->expects($this->any())->method('guessExtension')->will($this->returnValue('jpeg')); $entity = new DummyEntity(); $entity->setFile($file); $namer = new UniqidNamer(); $this->assertRegExp('/[a-z0-9]{13}.jpeg/', $namer->name($entity, 'file')); }
public function propertiesAccessProvider() { $date = new \DateTime(); $object = new DummyEntity(); $object->setFileName('joe.png'); $object->setFile($date); $array = array('fileName' => 'joe.png', 'file' => $date); return array(array($object, $date, 'joe.png'), array($array, $date, 'joe.png')); }