adjust modified dates to the correct timezone

This commit is contained in:
Robin Appelman 2013-09-08 14:31:26 +02:00
commit f8bc64f097
4 changed files with 33 additions and 2 deletions

View file

@ -48,4 +48,9 @@ class Server extends \PHPUnit_Framework_TestCase {
$server = new \SMB\Server(uniqid(), $this->config->user, $this->config->password);
$server->listShares();
}
public function testGetTimeZone() {
$timeZone = $this->server->getTimeZone();
$this->assertEquals('+0200', $timeZone);
}
}

View file

@ -266,7 +266,16 @@ class Share extends \PHPUnit_Framework_TestCase {
/**
* @expectedException \SMB\NotFoundException
*/
public function testRmDirNonExisting(){
public function testRmDirNonExisting() {
$this->share->rmdir('/foobar/asd');
}
public function testModifiedDate() {
$now = time();
$this->share->put($this->getTextFile(), $this->root . '/foo.txt');
$dir = $this->share->dir($this->root);
$mtime = $dir['foo.txt']['time'];
$this->assertTrue(abs($now - $mtime) <= 1, 'Modified time differs by ' . abs($now - $mtime) . ' seconds');
$this->share->del($this->root . '/foo.txt');
}
}