示例#1
0
 /**
  * {@inheritDoc}
  */
 public function touch($path, $mode = self::CREATION_MODE, $time = null)
 {
     return $this->stat($path)->then(function () use($path, $time) {
         if ($time === null) {
             $time = microtime(true);
         }
         return $this->invoker->invokeCall('eio_utime', [$path, $time, $time]);
     }, function () use($path, $mode) {
         return $this->openFileLimiter->open()->then(function () use($path, $mode) {
             return $this->invoker->invokeCall('eio_open', [$path, EIO_O_CREAT, $this->permissionFlagResolver->resolve($mode)]);
         })->then(function ($fd) use($path) {
             return $this->close($fd);
         });
     });
 }
 /**
  * @dataProvider testResolveProvider
  */
 public function testResolve($flags, $result)
 {
     $resolver = new PermissionFlagResolver();
     $this->assertSame($result, $resolver->resolve($flags));
 }