mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-09 09:58:49 +00:00
Initial Release of the calendar plugin
This commit is contained in:
parent
45cc9885fc
commit
7115197a33
561 changed files with 189494 additions and 0 deletions
76
dav/SabreDAV/tests/Sabre/DAV/FSExt/FileTest.php
Normal file
76
dav/SabreDAV/tests/Sabre/DAV/FSExt/FileTest.php
Normal file
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
|
||||
require_once 'Sabre/TestUtil.php';
|
||||
|
||||
class Sabre_DAV_FSExt_FileTest extends PHPUnit_Framework_TestCase {
|
||||
|
||||
function setUp() {
|
||||
|
||||
file_put_contents(SABRE_TEMPDIR . '/file.txt', 'Contents');
|
||||
|
||||
}
|
||||
|
||||
function tearDown() {
|
||||
|
||||
Sabre_TestUtil::clearTempDir();
|
||||
|
||||
}
|
||||
|
||||
function testPut() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$result = $file->put('New contents');
|
||||
|
||||
$this->assertEquals('New contents',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
|
||||
$this->assertEquals('"' . md5('New contents') . '"', $result);
|
||||
|
||||
}
|
||||
|
||||
function testRange() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$file->put('0000000');
|
||||
$file->putRange('111',3);
|
||||
|
||||
$this->assertEquals('0011100',file_get_contents(SABRE_TEMPDIR . '/file.txt'));
|
||||
|
||||
}
|
||||
|
||||
function testGet() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$this->assertEquals('Contents',stream_get_contents($file->get()));
|
||||
|
||||
}
|
||||
|
||||
function testDelete() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$file->delete();
|
||||
|
||||
$this->assertFalse(file_exists(SABRE_TEMPDIR . '/file.txt'));
|
||||
|
||||
}
|
||||
|
||||
function testGetETag() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$this->assertEquals('"' . md5('Contents') . '"',$file->getETag());
|
||||
|
||||
}
|
||||
|
||||
function testGetContentType() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$this->assertNull($file->getContentType());
|
||||
|
||||
}
|
||||
|
||||
function testGetSize() {
|
||||
|
||||
$file = new Sabre_DAV_FSExt_File(SABRE_TEMPDIR . '/file.txt');
|
||||
$this->assertEquals(8,$file->getSize());
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue