getLastModified() public method

public getLastModified ( $user, $imageIdentifier )
Exemplo n.º 1
0
 /**
  * @covers Imbo\Storage\GridFS::getLastModified
  * @covers Imbo\Storage\GridFS::imageExists
  */
 public function testGetLastModified()
 {
     $file = new TestFile();
     $cursor = $this->getMockBuilder('MongoGridFSCursor')->disableOriginalConstructor()->getMock();
     $cursor->expects($this->once())->method('count')->will($this->returnValue(1));
     $cursor->expects($this->once())->method('getNext')->will($this->returnValue($file));
     $this->grid->expects($this->once())->method('find')->will($this->returnValue($cursor));
     $this->assertInstanceOf('DateTime', $date = $this->driver->getLastModified($this->publicKey, $this->imageIdentifier));
     $this->assertSame(1334579830, $date->getTimestamp());
 }