From c7cbd388d6d9e90949f30ea37499d282895ea410 Mon Sep 17 00:00:00 2001 From: Pierre Buyle Date: Fri, 6 Jun 2014 10:18:13 -0500 Subject: [PATCH] Add test for issue #1979804: Files with a missing scheme cannot be edited. --- file_entity.test | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/file_entity.test b/file_entity.test index c0b402f..27d3cac 100644 --- a/file_entity.test +++ b/file_entity.test @@ -452,6 +452,27 @@ class FileEntityEditTestCase extends FileEntityTestHelper { $this->drupalGet('file/' . $file->fid . '/edit'); $this->assertNoFieldByName('name'); } + + /** + * Check edition of a file without a scheme. + */ + public function testFileEntityWithMissingSchemeEdit() { + // Create a private file without File entity enabled. + module_disable(array('file_entity')); + $test_file = $this->createFileEntity(array( + 'scheme' => 'private' + )); + + // Enable FileEntity + module_enable(array('file_entity')); + $this->cronRun(); + + // Edit the file + $this->drupalLogin($this->admin_user); + $this->drupalPost("file/{$test_file->fid}/edit", array(), t('Save')); + $this->assertUrl("file/{$test_file->fid}", array(), t('Private file edit successfully submitted.')); + $this->assertText(t("{$test_file->filename} has been updated"), t('Private file has been updated.')); + } } class FileEntityCreationTestCase extends FileEntityTestHelper { -- 1.9.1