Example #1
0
 /**
  * @dataProvider copyContentFromFileProvider
  */
 public function testCopyContentFromFile($fileInput, $expectedContent, $expectedContentType, $expectedSize)
 {
     $file = new File();
     $file->copyContentFromFile($fileInput);
     $stream = $file->getContentAsStream();
     $this->assertTrue(is_resource($stream));
     $this->assertEquals(0, ftell($stream), 'filepointer at the beginning of \\Doctrine\\ODM\\PHPCR\\Document\\Resource::data');
     $this->assertEquals($expectedContent, $file->getContentAsString());
     $this->assertEquals($expectedContentType, $file->getContentType());
     $this->assertEquals($expectedSize, $file->getSize());
     $this->assertInstanceOf('DateTime', $file->getUpdatedAt());
 }