Exemple #1
0
 /**
  * {@inheritDoc}
  */
 public function checksum($key)
 {
     return Checksum::fromFile($this->computePath($key));
 }
Exemple #2
0
 /**
  * {@inheritDoc}
  */
 public function write($key, $content)
 {
     $this->files[$key]['content'] = $content;
     $this->files[$key]['mtime'] = time();
     $this->files[$key]['checksum'] = Checksum::fromContent($content);
 }
Exemple #3
0
 public function testChecksumIsUpdatedOnWrite()
 {
     $adapter = new InMemory(array('foobar' => array('content' => 'Some content', 'checksum' => 'abcd')));
     $adapter->write('foobar', 'Changed content');
     $this->assertEquals(Checksum::fromContent('Changed content'), $adapter->checksum('foobar'));
 }
Exemple #4
0
 /**
  * Returns the checksum of the file
  *
  * @param  string $key
  *
  * @return string
  */
 public function checksum($key)
 {
     return Checksum::fromContent($this->read($key));
 }