Merge branch 'dev_MDL-33149_stored_file_access' of git://github.com/dongsheng/moodle

This commit is contained in:
Dan Poltawski
2012-05-22 16:51:33 +08:00
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ class stored_file {
/** @var string location of content files */
private $filedir;
/** @var repository repository plugin instance */
public $repository;
private $repository;
/**
* Constructor, this constructor should be called ONLY from the file_storage class!
+1 -1
View File
@@ -183,7 +183,7 @@ class filestoragelib_testcase extends advanced_testcase {
$ref = $fs->pack_reference($filerecord);
$newstoredfile = $fs->create_file_from_reference($newfilerecord, $userrepository->id, $ref);
$this->assertInstanceOf('stored_file', $newstoredfile);
$this->assertEquals($userrepository->id, $newstoredfile->repository->id);
$this->assertEquals($userrepository->id, $newstoredfile->get_repository_id());
$this->assertEquals($originalfile->get_contenthash(), $newstoredfile->get_contenthash());
$this->assertEquals($originalfile->get_filesize(), $newstoredfile->get_filesize());
$this->assertRegExp('#' . $filename. '$#', $newstoredfile->get_reference_details());
+2 -2
View File
@@ -151,7 +151,7 @@ class filelib_testcase extends advanced_testcase {
// create a file reference
$fileref = $fs->create_file_from_reference($filerefrecord, $userrepository->id, $userfileref);
$this->assertInstanceOf('stored_file', $fileref);
$this->assertEquals($userrepository->id, $fileref->repository->id);
$this->assertEquals($userrepository->id, $fileref->get_repository_id());
$this->assertEquals($userfile->get_contenthash(), $fileref->get_contenthash());
$this->assertEquals($userfile->get_filesize(), $fileref->get_filesize());
$this->assertRegExp('#' . $userfile->get_filename(). '$#', $fileref->get_reference_details());
@@ -249,7 +249,7 @@ class filelib_testcase extends advanced_testcase {
// create a file reference
$fileref = $fs->create_file_from_reference($filerecord, $userrepository->id, $userfileref);
$this->assertInstanceOf('stored_file', $fileref);
$this->assertEquals($userrepository->id, $fileref->repository->id);
$this->assertEquals($userrepository->id, $fileref->get_repository_id());
$this->assertEquals($userfile->get_contenthash(), $fileref->get_contenthash());
$this->assertEquals($userfile->get_filesize(), $fileref->get_filesize());
$this->assertRegExp('#' . $userfile->get_filename(). '$#', $fileref->get_reference_details());