GitHub PullRequestReviewCommentEvent at 2014-07-15 17:53:10
Repository: islandora
Actor: adam-vessey
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Islandora/islandora/pulls/comments/14951341","id":14951341,"diff_hunk":"@@ -0,0 +1,77 @@\n+<?php\n+/**\n+ * @file\n+ * Islandora extensions for DrupalUnitTestCase.\n+ */\n+\n+class IslandoraUnitTestCase extends DrupalUnitTestCase {\n+\n+  /**\n+   * By default, deleteUserCreatedObjects() runs on each tearDown() step.\n+   *\n+   * @var bool\n+   */\n+  protected $deleteObjectsOnTeardown = TRUE;\n+\n+  /**\n+   * Defers to IslandoraTestUtilities for missing methods.\n+   *\n+   * @param string $method\n+   *   The method being called.\n+   * @param array $args\n+   *   The arguments for that method.\n+   */\n+  public function __call($method, $args) {\n+    module_load_include('inc', 'islandora', 'tests/includes/utilities');\n+    $params = array('db_access' => FALSE);\n+    $utilities = new IslandoraTestUtilities($this->configuration, $params);\n+    if (!method_exists($utilities, $method)) {\n+      $caller = $this->getAssertionCall();\n+      throw new BadMethodCallException(\"Exception: undefined method $method in {$caller['file']}, line {$caller['line']}.\");\n+    }\n+    $result = call_user_func_array(array(&$utilities, $method), $args);\n+    $this->parseUtilityResults($utilities);\n+    return $result;\n+  }\n+\n+  /**\n+   * Parses utility results and passes them to the test results as an assertion.\n+   *\n+   * @param IslandoraTestUtilities $utility\n+   *   An instance of IslandoraTestUtilities with populated results.\n+   */\n+  public function parseUtilityResults($utility) {\n+    foreach ($utility->getResults() as $result) {\n+      $this->assert($result->getType(), $result->getMessage(), 'Islandora', $result->getCaller());\n+    }\n+  }\n+\n+  /**\n+   * Sets up the Drupal filter to access this test Drupal instances database.\n+   *\n+   * @see DrupalWebTestCase::setUp()\n+   */\n+  public function setUp() {\n+    parent::setUp();\n+\n+    // It's possible test are running before class autoloading.\n+    module_load_include('inc', 'islandora', 'includes/tuque');\n+    module_load_include('inc', 'islandora', 'includes/tuque_wrapper');","path":"tests/includes/islandora_unit_test_case.inc","position":59,"original_position":59,"commit_id":"3b797253add6c7f965d56e9a47600eb15af5604a","original_commit_id":"3b797253add6c7f965d56e9a47600eb15af5604a","user":{"login":"adam-vessey","id":607975,"avatar_url":"https://avatars.githubusercontent.com/u/607975?","gravatar_id":"d3687afe988a5b9fd8d41775e99274b3","url":"https://api.github.com/users/adam-vessey","html_url":"https://github.com/adam-vessey","followers_url":"https://api.github.com/users/adam-vessey/followers","following_url":"https://api.github.com/users/adam-vessey/following{/other_user}","gists_url":"https://api.github.com/users/adam-vessey/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-vessey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-vessey/subscriptions","organizations_url":"https://api.github.com/users/adam-vessey/orgs","repos_url":"https://api.github.com/users/adam-vessey/repos","events_url":"https://api.github.com/users/adam-vessey/events{/privacy}","received_events_url":"https://api.github.com/users/adam-vessey/received_events","type":"User","site_admin":false},"body":"Not sure this is necessary here, since we're not touching the wrapper?","created_at":"2014-07-15T17:53:10Z","updated_at":"2014-07-15T17:53:10Z","html_url":"https://github.com/Islandora/islandora/pull/507#discussion_r14951341","pull_request_url":"https://api.github.com/repos/Islandora/islandora/pulls/507","_links":{"self":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/comments/14951341"},"html":{"href":"https://github.com/Islandora/islandora/pull/507#discussion_r14951341"},"pull_request":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/507"}}},"pull_request":{"url":"https://api.github.com/repos/Islandora/islandora/pulls/507","id":16165059,"html_url":"https://github.com/Islandora/islandora/pull/507","diff_url":"https://github.com/Islandora/islandora/pull/507.diff","patch_url":"https://github.com/Islandora/islandora/pull/507.patch","issue_url":"https://api.github.com/repos/Islandora/islandora/issues/507","number":507,"state":"open","title":"7.x web and unit test cases","user":{"login":"qadan","id":3406327,"avatar_url":"https://avatars.githubusercontent.com/u/3406327?","gravatar_id":"3bd7391c1a27c94d783bcc439b35e053","url":"https://api.github.com/users/qadan","html_url":"https://github.com/qadan","followers_url":"https://api.github.com/users/qadan/followers","following_url":"https://api.github.com/users/qadan/following{/other_user}","gists_url":"https://api.github.com/users/qadan/gists{/gist_id}","starred_url":"https://api.github.com/users/qadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qadan/subscriptions","organizations_url":"https://api.github.com/users/qadan/orgs","repos_url":"https://api.github.com/users/qadan/repos","events_url":"https://api.github.com/users/qadan/events{/privacy}","received_events_url":"https://api.github.com/users/qadan/received_events","type":"User","site_admin":false},"body":"This pull does some wonderful fun things! Hurrah!\r\n\r\n- Islandora test cases are now split out between the IslandoraWebTestCase and IslandoraUnitTestCase. The IslandoraUnitTestCase has no database access and does not enable modules, but otherwise functions the same. Note that it is largely untested beyond basic utility and assertion functionality.\r\n- Several chunks of functionality have been broken out and are now been placed inside tests/includes/utilities.inc. This includes a class to safely store and manipulate the Drupal filter, a class to handle utility test results in a consistent fashion, and a utilities class that includes test utility methods that work irrespective of the context they are called from, and use the utility test result class to pass through consistent results. Some of these methods have been reformatted to function properly outside of a Drupal context. Regression tests have been run to ensure no loss of test functionality.\r\n- The datastream validator results class has been generalized into the utility results class mentioned above.\r\n- An abstract IslandoraTestUtilityClass has been created to support creating future test utility classes that are compatible with utility test results. To add a result to a test from within a test utility class, use $this->addResult().\r\n- PHP overloading is being used to call test utility methods, so that no functionality is lost from attempting to call test utilities from $this context. These methods are not being registered in the TestCases, so it is worth noting that IDEs using method/property checking and autocompletion will not find test utility methods when calling $this->testUtilityMethod from inside a TestCase. This is, however, a valid method of calling test utility methods; check the IslandoraTestUtilities class to see what methods are valid in both (and future) test cases. \r\n- General cleanup (i.e. I shoved the includes in a folder, no biggie).","created_at":"2014-05-21T14:10:09Z","updated_at":"2014-07-15T17:53:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0df90e0c2747a8797ef95f5cff43f205cdd662c8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Islandora/islandora/pulls/507/commits","review_comments_url":"https://api.github.com/repos/Islandora/islandora/pulls/507/comments","review_comment_url":"https://api.github.com/repos/Islandora/islandora/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Islandora/islandora/issues/507/comments","statuses_url":"https://api.github.com/repos/Islandora/islandora/statuses/3b797253add6c7f965d56e9a47600eb15af5604a","head":{"label":"qadan:7.x","ref":"7.x","sha":"3b797253add6c7f965d56e9a47600eb15af5604a","user":{"login":"qadan","id":3406327,"avatar_url":"https://avatars.githubusercontent.com/u/3406327?","gravatar_id":"3bd7391c1a27c94d783bcc439b35e053","url":"https://api.github.com/users/qadan","html_url":"https://github.com/qadan","followers_url":"https://api.github.com/users/qadan/followers","following_url":"https://api.github.com/users/qadan/following{/other_user}","gists_url":"https://api.github.com/users/qadan/gists{/gist_id}","starred_url":"https://api.github.com/users/qadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qadan/subscriptions","organizations_url":"https://api.github.com/users/qadan/orgs","repos_url":"https://api.github.com/users/qadan/repos","events_url":"https://api.github.com/users/qadan/events{/privacy}","received_events_url":"https://api.github.com/users/qadan/received_events","type":"User","site_admin":false},"repo":{"id":16011151,"name":"islandora","full_name":"qadan/islandora","owner":{"login":"qadan","id":3406327,"avatar_url":"https://avatars.githubusercontent.com/u/3406327?","gravatar_id":"3bd7391c1a27c94d783bcc439b35e053","url":"https://api.github.com/users/qadan","html_url":"https://github.com/qadan","followers_url":"https://api.github.com/users/qadan/followers","following_url":"https://api.github.com/users/qadan/following{/other_user}","gists_url":"https://api.github.com/users/qadan/gists{/gist_id}","starred_url":"https://api.github.com/users/qadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qadan/subscriptions","organizations_url":"https://api.github.com/users/qadan/orgs","repos_url":"https://api.github.com/users/qadan/repos","events_url":"https://api.github.com/users/qadan/events{/privacy}","received_events_url":"https://api.github.com/users/qadan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qadan/islandora","description":"A Drupal module for browsing and managing Fedora-based digital repositories","fork":true,"url":"https://api.github.com/repos/qadan/islandora","forks_url":"https://api.github.com/repos/qadan/islandora/forks","keys_url":"https://api.github.com/repos/qadan/islandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qadan/islandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qadan/islandora/teams","hooks_url":"https://api.github.com/repos/qadan/islandora/hooks","issue_events_url":"https://api.github.com/repos/qadan/islandora/issues/events{/number}","events_url":"https://api.github.com/repos/qadan/islandora/events","assignees_url":"https://api.github.com/repos/qadan/islandora/assignees{/user}","branches_url":"https://api.github.com/repos/qadan/islandora/branches{/branch}","tags_url":"https://api.github.com/repos/qadan/islandora/tags","blobs_url":"https://api.github.com/repos/qadan/islandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qadan/islandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qadan/islandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/qadan/islandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qadan/islandora/statuses/{sha}","languages_url":"https://api.github.com/repos/qadan/islandora/languages","stargazers_url":"https://api.github.com/repos/qadan/islandora/stargazers","contributors_url":"https://api.github.com/repos/qadan/islandora/contributors","subscribers_url":"https://api.github.com/repos/qadan/islandora/subscribers","subscription_url":"https://api.github.com/repos/qadan/islandora/subscription","commits_url":"https://api.github.com/repos/qadan/islandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/qadan/islandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/qadan/islandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/qadan/islandora/issues/comments/{number}","contents_url":"https://api.github.com/repos/qadan/islandora/contents/{+path}","compare_url":"https://api.github.com/repos/qadan/islandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qadan/islandora/merges","archive_url":"https://api.github.com/repos/qadan/islandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qadan/islandora/downloads","issues_url":"https://api.github.com/repos/qadan/islandora/issues{/number}","pulls_url":"https://api.github.com/repos/qadan/islandora/pulls{/number}","milestones_url":"https://api.github.com/repos/qadan/islandora/milestones{/number}","notifications_url":"https://api.github.com/repos/qadan/islandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qadan/islandora/labels{/name}","releases_url":"https://api.github.com/repos/qadan/islandora/releases{/id}","created_at":"2014-01-17T20:40:01Z","updated_at":"2014-06-18T15:10:46Z","pushed_at":"2014-06-18T15:10:45Z","git_url":"git://github.com/qadan/islandora.git","ssh_url":"git@github.com:qadan/islandora.git","clone_url":"https://github.com/qadan/islandora.git","svn_url":"https://github.com/qadan/islandora","homepage":"http://islandora.ca/","size":17600,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"7.x"}},"base":{"label":"Islandora:7.x","ref":"7.x","sha":"3e0fc461d9dce63ad5868071f5f366a32a39b001","user":{"login":"Islandora","id":494054,"avatar_url":"https://avatars.githubusercontent.com/u/494054?","gravatar_id":"b8cf86b31d307420ade6a9ec292f58e1","url":"https://api.github.com/users/Islandora","html_url":"https://github.com/Islandora","followers_url":"https://api.github.com/users/Islandora/followers","following_url":"https://api.github.com/users/Islandora/following{/other_user}","gists_url":"https://api.github.com/users/Islandora/gists{/gist_id}","starred_url":"https://api.github.com/users/Islandora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Islandora/subscriptions","organizations_url":"https://api.github.com/users/Islandora/orgs","repos_url":"https://api.github.com/users/Islandora/repos","events_url":"https://api.github.com/users/Islandora/events{/privacy}","received_events_url":"https://api.github.com/users/Islandora/received_events","type":"Organization","site_admin":false},"repo":{"id":1107291,"name":"islandora","full_name":"Islandora/islandora","owner":{"login":"Islandora","id":494054,"avatar_url":"https://avatars.githubusercontent.com/u/494054?","gravatar_id":"b8cf86b31d307420ade6a9ec292f58e1","url":"https://api.github.com/users/Islandora","html_url":"https://github.com/Islandora","followers_url":"https://api.github.com/users/Islandora/followers","following_url":"https://api.github.com/users/Islandora/following{/other_user}","gists_url":"https://api.github.com/users/Islandora/gists{/gist_id}","starred_url":"https://api.github.com/users/Islandora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Islandora/subscriptions","organizations_url":"https://api.github.com/users/Islandora/orgs","repos_url":"https://api.github.com/users/Islandora/repos","events_url":"https://api.github.com/users/Islandora/events{/privacy}","received_events_url":"https://api.github.com/users/Islandora/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Islandora/islandora","description":"A Drupal module for browsing and managing Fedora-based digital repositories","fork":true,"url":"https://api.github.com/repos/Islandora/islandora","forks_url":"https://api.github.com/repos/Islandora/islandora/forks","keys_url":"https://api.github.com/repos/Islandora/islandora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Islandora/islandora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Islandora/islandora/teams","hooks_url":"https://api.github.com/repos/Islandora/islandora/hooks","issue_events_url":"https://api.github.com/repos/Islandora/islandora/issues/events{/number}","events_url":"https://api.github.com/repos/Islandora/islandora/events","assignees_url":"https://api.github.com/repos/Islandora/islandora/assignees{/user}","branches_url":"https://api.github.com/repos/Islandora/islandora/branches{/branch}","tags_url":"https://api.github.com/repos/Islandora/islandora/tags","blobs_url":"https://api.github.com/repos/Islandora/islandora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Islandora/islandora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Islandora/islandora/git/refs{/sha}","trees_url":"https://api.github.com/repos/Islandora/islandora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Islandora/islandora/statuses/{sha}","languages_url":"https://api.github.com/repos/Islandora/islandora/languages","stargazers_url":"https://api.github.com/repos/Islandora/islandora/stargazers","contributors_url":"https://api.github.com/repos/Islandora/islandora/contributors","subscribers_url":"https://api.github.com/repos/Islandora/islandora/subscribers","subscription_url":"https://api.github.com/repos/Islandora/islandora/subscription","commits_url":"https://api.github.com/repos/Islandora/islandora/commits{/sha}","git_commits_url":"https://api.github.com/repos/Islandora/islandora/git/commits{/sha}","comments_url":"https://api.github.com/repos/Islandora/islandora/comments{/number}","issue_comment_url":"https://api.github.com/repos/Islandora/islandora/issues/comments/{number}","contents_url":"https://api.github.com/repos/Islandora/islandora/contents/{+path}","compare_url":"https://api.github.com/repos/Islandora/islandora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Islandora/islandora/merges","archive_url":"https://api.github.com/repos/Islandora/islandora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Islandora/islandora/downloads","issues_url":"https://api.github.com/repos/Islandora/islandora/issues{/number}","pulls_url":"https://api.github.com/repos/Islandora/islandora/pulls{/number}","milestones_url":"https://api.github.com/repos/Islandora/islandora/milestones{/number}","notifications_url":"https://api.github.com/repos/Islandora/islandora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Islandora/islandora/labels{/name}","releases_url":"https://api.github.com/repos/Islandora/islandora/releases{/id}","created_at":"2010-11-23T21:56:01Z","updated_at":"2014-07-05T16:22:00Z","pushed_at":"2014-07-15T13:40:32Z","git_url":"git://github.com/Islandora/islandora.git","ssh_url":"git@github.com:Islandora/islandora.git","clone_url":"https://github.com/Islandora/islandora.git","svn_url":"https://github.com/Islandora/islandora","homepage":"http://islandora.ca/","size":36840,"stargazers_count":56,"watchers_count":56,"language":"Assembly","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":55,"mirror_url":null,"open_issues_count":4,"forks":55,"open_issues":4,"watchers":56,"default_branch":"7.x"}},"_links":{"self":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/507"},"html":{"href":"https://github.com/Islandora/islandora/pull/507"},"issue":{"href":"https://api.github.com/repos/Islandora/islandora/issues/507"},"comments":{"href":"https://api.github.com/repos/Islandora/islandora/issues/507/comments"},"review_comments":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/507/comments"},"review_comment":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Islandora/islandora/pulls/507/commits"},"statuses":{"href":"https://api.github.com/repos/Islandora/islandora/statuses/3b797253add6c7f965d56e9a47600eb15af5604a"}}}}