{"action":"created","comment":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/42183500","id":42183500,"diff_hunk":"@@ -97,6 +97,34 @@ function testElggGetFileSimpletype() {\n \t\t}\n \t}\n \n+\tfunction testDetectMimeType() {\n+\n+\t\t$user = $this->createTestUser();\n+\n+\t\t$file = new \\ElggFile();\n+\t\t$file->owner_guid = $user->guid;\n+\t\t$file->setFilename('testing/filestore.txt');\n+\t\t$file->open('write');\n+\t\t$file->write('Testing!');\n+\t\t$file->close();\n+\n+\t\t$mime = $file->detectMimeType(null, 'text/plain');\n+\n+\t\t// mime should not be null if default is set\n+\t\t$this->assertTrue(isset($mime));\n+\n+\t\t// mime of a file object should match mime of a file path that represents this file on filestore\n+\t\t$resource_mime = $file->detectMimeType($file->getFilenameOnFilestore(), 'text/plain');\n+\t\t$this->assertIdentical($mime, $resource_mime);\n+\n+\t\t// method output should not differ between a static and a concrete call if the file path is set\n+\t\t$resource_mime_static = ElggFile::detectMimeType($file->getFilenameOnFilestore(), 'text/plain');","path":"engine/tests/ElggCoreFilestoreTest.php","position":25,"original_position":25,"commit_id":"a7aef6f90dd660bd2a377c77b768d275fe3832fb","original_commit_id":"ecf510746058702b0b5a60a5545b50d90ca5420a","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"body":"Unless we declare detectMimeType as static again. It would make sense because it is a static function...","created_at":"2015-10-15T21:33:00Z","updated_at":"2015-10-15T21:33:00Z","html_url":"https://github.com/Elgg/Elgg/pull/9015#discussion_r42183500","pull_request_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9015","_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments/42183500"},"html":{"href":"https://github.com/Elgg/Elgg/pull/9015#discussion_r42183500"},"pull_request":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9015"}}},"pull_request":{"url":"https://api.github.com/repos/Elgg/Elgg/pulls/9015","id":47344064,"html_url":"https://github.com/Elgg/Elgg/pull/9015","diff_url":"https://github.com/Elgg/Elgg/pull/9015.diff","patch_url":"https://github.com/Elgg/Elgg/pull/9015.patch","issue_url":"https://api.github.com/repos/Elgg/Elgg/issues/9015","number":9015,"state":"open","locked":false,"title":"fix(files): make sure method is callable on a concrete object instance","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"body":"PHP treats $this as an instance of a calling class when ElggFile::detectMimeType is called\r\nstatically.\r\n\r\nFixes #9010 ","created_at":"2015-10-10T11:47:24Z","updated_at":"2015-10-15T21:33:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9597ad67136d3ad05723cf383ce01cad819c57a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9015/commits","review_comments_url":"https://api.github.com/repos/Elgg/Elgg/pulls/9015/comments","review_comment_url":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Elgg/Elgg/issues/9015/comments","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/a7aef6f90dd660bd2a377c77b768d275fe3832fb","head":{"label":"hypeJunction:detectmime","ref":"detectmime","sha":"a7aef6f90dd660bd2a377c77b768d275fe3832fb","user":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"repo":{"id":2797801,"name":"Elgg","full_name":"hypeJunction/Elgg","owner":{"login":"hypeJunction","id":1202761,"avatar_url":"https://avatars.githubusercontent.com/u/1202761?v=3","gravatar_id":"","url":"https://api.github.com/users/hypeJunction","html_url":"https://github.com/hypeJunction","followers_url":"https://api.github.com/users/hypeJunction/followers","following_url":"https://api.github.com/users/hypeJunction/following{/other_user}","gists_url":"https://api.github.com/users/hypeJunction/gists{/gist_id}","starred_url":"https://api.github.com/users/hypeJunction/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hypeJunction/subscriptions","organizations_url":"https://api.github.com/users/hypeJunction/orgs","repos_url":"https://api.github.com/users/hypeJunction/repos","events_url":"https://api.github.com/users/hypeJunction/events{/privacy}","received_events_url":"https://api.github.com/users/hypeJunction/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hypeJunction/Elgg","description":"A social networking engine","fork":true,"url":"https://api.github.com/repos/hypeJunction/Elgg","forks_url":"https://api.github.com/repos/hypeJunction/Elgg/forks","keys_url":"https://api.github.com/repos/hypeJunction/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hypeJunction/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hypeJunction/Elgg/teams","hooks_url":"https://api.github.com/repos/hypeJunction/Elgg/hooks","issue_events_url":"https://api.github.com/repos/hypeJunction/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/hypeJunction/Elgg/events","assignees_url":"https://api.github.com/repos/hypeJunction/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/hypeJunction/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/hypeJunction/Elgg/tags","blobs_url":"https://api.github.com/repos/hypeJunction/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hypeJunction/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hypeJunction/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/hypeJunction/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hypeJunction/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/hypeJunction/Elgg/languages","stargazers_url":"https://api.github.com/repos/hypeJunction/Elgg/stargazers","contributors_url":"https://api.github.com/repos/hypeJunction/Elgg/contributors","subscribers_url":"https://api.github.com/repos/hypeJunction/Elgg/subscribers","subscription_url":"https://api.github.com/repos/hypeJunction/Elgg/subscription","commits_url":"https://api.github.com/repos/hypeJunction/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/hypeJunction/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/hypeJunction/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/hypeJunction/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/hypeJunction/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/hypeJunction/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hypeJunction/Elgg/merges","archive_url":"https://api.github.com/repos/hypeJunction/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hypeJunction/Elgg/downloads","issues_url":"https://api.github.com/repos/hypeJunction/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/hypeJunction/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/hypeJunction/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/hypeJunction/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hypeJunction/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/hypeJunction/Elgg/releases{/id}","created_at":"2011-11-17T18:59:58Z","updated_at":"2015-05-09T06:40:26Z","pushed_at":"2015-10-15T21:32:04Z","git_url":"git://github.com/hypeJunction/Elgg.git","ssh_url":"git@github.com:hypeJunction/Elgg.git","clone_url":"https://github.com/hypeJunction/Elgg.git","svn_url":"https://github.com/hypeJunction/Elgg","homepage":"http://elgg.org","size":42162,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"Elgg:1.12","ref":"1.12","sha":"ca8aec1ec16eb4b138541b11f5c2b8c7406aac0c","user":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"repo":{"id":299271,"name":"Elgg","full_name":"Elgg/Elgg","owner":{"login":"Elgg","id":79167,"avatar_url":"https://avatars.githubusercontent.com/u/79167?v=3","gravatar_id":"","url":"https://api.github.com/users/Elgg","html_url":"https://github.com/Elgg","followers_url":"https://api.github.com/users/Elgg/followers","following_url":"https://api.github.com/users/Elgg/following{/other_user}","gists_url":"https://api.github.com/users/Elgg/gists{/gist_id}","starred_url":"https://api.github.com/users/Elgg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Elgg/subscriptions","organizations_url":"https://api.github.com/users/Elgg/orgs","repos_url":"https://api.github.com/users/Elgg/repos","events_url":"https://api.github.com/users/Elgg/events{/privacy}","received_events_url":"https://api.github.com/users/Elgg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Elgg/Elgg","description":"A social networking engine in PHP/MySQL","fork":false,"url":"https://api.github.com/repos/Elgg/Elgg","forks_url":"https://api.github.com/repos/Elgg/Elgg/forks","keys_url":"https://api.github.com/repos/Elgg/Elgg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Elgg/Elgg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Elgg/Elgg/teams","hooks_url":"https://api.github.com/repos/Elgg/Elgg/hooks","issue_events_url":"https://api.github.com/repos/Elgg/Elgg/issues/events{/number}","events_url":"https://api.github.com/repos/Elgg/Elgg/events","assignees_url":"https://api.github.com/repos/Elgg/Elgg/assignees{/user}","branches_url":"https://api.github.com/repos/Elgg/Elgg/branches{/branch}","tags_url":"https://api.github.com/repos/Elgg/Elgg/tags","blobs_url":"https://api.github.com/repos/Elgg/Elgg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Elgg/Elgg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Elgg/Elgg/git/refs{/sha}","trees_url":"https://api.github.com/repos/Elgg/Elgg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Elgg/Elgg/statuses/{sha}","languages_url":"https://api.github.com/repos/Elgg/Elgg/languages","stargazers_url":"https://api.github.com/repos/Elgg/Elgg/stargazers","contributors_url":"https://api.github.com/repos/Elgg/Elgg/contributors","subscribers_url":"https://api.github.com/repos/Elgg/Elgg/subscribers","subscription_url":"https://api.github.com/repos/Elgg/Elgg/subscription","commits_url":"https://api.github.com/repos/Elgg/Elgg/commits{/sha}","git_commits_url":"https://api.github.com/repos/Elgg/Elgg/git/commits{/sha}","comments_url":"https://api.github.com/repos/Elgg/Elgg/comments{/number}","issue_comment_url":"https://api.github.com/repos/Elgg/Elgg/issues/comments{/number}","contents_url":"https://api.github.com/repos/Elgg/Elgg/contents/{+path}","compare_url":"https://api.github.com/repos/Elgg/Elgg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Elgg/Elgg/merges","archive_url":"https://api.github.com/repos/Elgg/Elgg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Elgg/Elgg/downloads","issues_url":"https://api.github.com/repos/Elgg/Elgg/issues{/number}","pulls_url":"https://api.github.com/repos/Elgg/Elgg/pulls{/number}","milestones_url":"https://api.github.com/repos/Elgg/Elgg/milestones{/number}","notifications_url":"https://api.github.com/repos/Elgg/Elgg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Elgg/Elgg/labels{/name}","releases_url":"https://api.github.com/repos/Elgg/Elgg/releases{/id}","created_at":"2009-09-06T17:10:11Z","updated_at":"2015-10-12T17:44:29Z","pushed_at":"2015-10-15T21:32:05Z","git_url":"git://github.com/Elgg/Elgg.git","ssh_url":"git@github.com:Elgg/Elgg.git","clone_url":"https://github.com/Elgg/Elgg.git","svn_url":"https://github.com/Elgg/Elgg","homepage":"http://elgg.org","size":82311,"stargazers_count":780,"watchers_count":780,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":450,"mirror_url":null,"open_issues_count":837,"forks":450,"open_issues":837,"watchers":780,"default_branch":"2.x"}},"_links":{"self":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9015"},"html":{"href":"https://github.com/Elgg/Elgg/pull/9015"},"issue":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/9015"},"comments":{"href":"https://api.github.com/repos/Elgg/Elgg/issues/9015/comments"},"review_comments":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9015/comments"},"review_comment":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Elgg/Elgg/pulls/9015/commits"},"statuses":{"href":"https://api.github.com/repos/Elgg/Elgg/statuses/a7aef6f90dd660bd2a377c77b768d275fe3832fb"}}}}