{"action":"created","comment":{"url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/comments/47909546","id":47909546,"diff_hunk":"@@ -212,4 +212,42 @@ public function createLanguages($langcode) {\n     $this->languageCreate((object) ['langcode' => $langcode]);\n   }\n \n+  /**\n+   * Prepare for PHP errors log.\n+   *\n+   * @BeforeSuite\n+   */\n+  public static function preparePhpErrors($event) {\n+    // Clear out the watchdog table at the beginning of each test suite.\n+    db_truncate('watchdog')->execute();\n+  }\n+\n+  /**\n+   * Check for PHP errors log.\n+   *\n+   * @AfterSuite\n+   */\n+  public static function checkPhpErrors($event) {\n+    // Find any PHP errors at the end of the suite\n+    // and output them as an exception.\n+    $log = db_select('watchdog', 'w')\n+      ->fields('w')\n+      ->condition('w.type', 'php', '=')\n+      ->execute()\n+      ->fetchAll();\n+    if (!empty($log)) {\n+      $errors = count($log);\n+      $message = \"$errors PHP errors were logged to the watchdog in this suite:\\n\\n\";\n+      foreach ($log as $error) {\n+        $error->variables = unserialize($error->variables);\n+        $date = date('Y-m-d H:i:sP', $error->timestamp);\n+        $message .= sprintf(\"Message: %s: %s in %s (line %s of %s).\\n\", $error->variables['%type'], $error->variables['!message'], $error->variables['%function'], $error->variables['%line'], $error->variables['%file']);\n+        $message .= \"Location: $error->location\\n\";\n+        $message .= \"Referer: $error->referer\\n\";\n+        $message .= \"Date/Time: $date\\n\\n\";\n+      }\n+      throw new Exception($message);\n+    }","path":"tests/features/bootstrap/FeatureContext.php","position":39,"original_position":39,"commit_id":"4e33e9a8b44fd7b8f2edfc5cde488929686e09eb","original_commit_id":"4e33e9a8b44fd7b8f2edfc5cde488929686e09eb","user":{"login":"pfrenssen","id":442924,"avatar_url":"https://avatars.githubusercontent.com/u/442924?v=3","gravatar_id":"","url":"https://api.github.com/users/pfrenssen","html_url":"https://github.com/pfrenssen","followers_url":"https://api.github.com/users/pfrenssen/followers","following_url":"https://api.github.com/users/pfrenssen/following{/other_user}","gists_url":"https://api.github.com/users/pfrenssen/gists{/gist_id}","starred_url":"https://api.github.com/users/pfrenssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pfrenssen/subscriptions","organizations_url":"https://api.github.com/users/pfrenssen/orgs","repos_url":"https://api.github.com/users/pfrenssen/repos","events_url":"https://api.github.com/users/pfrenssen/events{/privacy}","received_events_url":"https://api.github.com/users/pfrenssen/received_events","type":"User","site_admin":false},"body":"It would be great to include some information about the actual test that caused the bug, like the file where the error occurred, and the line number of the step where the error occurred.\r\n\r\nYou can get the filename from `$event->getFeature()->getFile()`, the line number from `$event->getStep()->getLine()`. The content of the step definition is in `$event->getStep()->getText()`","created_at":"2015-12-17T14:17:13Z","updated_at":"2015-12-17T14:17:13Z","html_url":"https://github.com/ec-europa/platform-dev/pull/294#discussion_r47909546","pull_request_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294","_links":{"self":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/comments/47909546"},"html":{"href":"https://github.com/ec-europa/platform-dev/pull/294#discussion_r47909546"},"pull_request":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294","id":53569132,"html_url":"https://github.com/ec-europa/platform-dev/pull/294","diff_url":"https://github.com/ec-europa/platform-dev/pull/294.diff","patch_url":"https://github.com/ec-europa/platform-dev/pull/294.patch","issue_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/294","number":294,"state":"open","locked":false,"title":"NEXTEUROPA-7552: check for php errors in db log","user":{"login":"gervasek","id":14055017,"avatar_url":"https://avatars.githubusercontent.com/u/14055017?v=3","gravatar_id":"","url":"https://api.github.com/users/gervasek","html_url":"https://github.com/gervasek","followers_url":"https://api.github.com/users/gervasek/followers","following_url":"https://api.github.com/users/gervasek/following{/other_user}","gists_url":"https://api.github.com/users/gervasek/gists{/gist_id}","starred_url":"https://api.github.com/users/gervasek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gervasek/subscriptions","organizations_url":"https://api.github.com/users/gervasek/orgs","repos_url":"https://api.github.com/users/gervasek/repos","events_url":"https://api.github.com/users/gervasek/events{/privacy}","received_events_url":"https://api.github.com/users/gervasek/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-14T14:12:33Z","updated_at":"2015-12-17T14:17:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32b533ba77f8333abe87f4544b2e2edfea5f98fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294/commits","review_comments_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294/comments","review_comment_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/294/comments","statuses_url":"https://api.github.com/repos/ec-europa/platform-dev/statuses/4e33e9a8b44fd7b8f2edfc5cde488929686e09eb","head":{"label":"ec-europa:HOTFIX/NEXTEUROPA-7552","ref":"HOTFIX/NEXTEUROPA-7552","sha":"4e33e9a8b44fd7b8f2edfc5cde488929686e09eb","user":{"login":"ec-europa","id":10885565,"avatar_url":"https://avatars.githubusercontent.com/u/10885565?v=3","gravatar_id":"","url":"https://api.github.com/users/ec-europa","html_url":"https://github.com/ec-europa","followers_url":"https://api.github.com/users/ec-europa/followers","following_url":"https://api.github.com/users/ec-europa/following{/other_user}","gists_url":"https://api.github.com/users/ec-europa/gists{/gist_id}","starred_url":"https://api.github.com/users/ec-europa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ec-europa/subscriptions","organizations_url":"https://api.github.com/users/ec-europa/orgs","repos_url":"https://api.github.com/users/ec-europa/repos","events_url":"https://api.github.com/users/ec-europa/events{/privacy}","received_events_url":"https://api.github.com/users/ec-europa/received_events","type":"Organization","site_admin":false},"repo":{"id":41666809,"name":"platform-dev","full_name":"ec-europa/platform-dev","owner":{"login":"ec-europa","id":10885565,"avatar_url":"https://avatars.githubusercontent.com/u/10885565?v=3","gravatar_id":"","url":"https://api.github.com/users/ec-europa","html_url":"https://github.com/ec-europa","followers_url":"https://api.github.com/users/ec-europa/followers","following_url":"https://api.github.com/users/ec-europa/following{/other_user}","gists_url":"https://api.github.com/users/ec-europa/gists{/gist_id}","starred_url":"https://api.github.com/users/ec-europa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ec-europa/subscriptions","organizations_url":"https://api.github.com/users/ec-europa/orgs","repos_url":"https://api.github.com/users/ec-europa/repos","events_url":"https://api.github.com/users/ec-europa/events{/privacy}","received_events_url":"https://api.github.com/users/ec-europa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ec-europa/platform-dev","description":"NextEuropa platform","fork":false,"url":"https://api.github.com/repos/ec-europa/platform-dev","forks_url":"https://api.github.com/repos/ec-europa/platform-dev/forks","keys_url":"https://api.github.com/repos/ec-europa/platform-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ec-europa/platform-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ec-europa/platform-dev/teams","hooks_url":"https://api.github.com/repos/ec-europa/platform-dev/hooks","issue_events_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/events{/number}","events_url":"https://api.github.com/repos/ec-europa/platform-dev/events","assignees_url":"https://api.github.com/repos/ec-europa/platform-dev/assignees{/user}","branches_url":"https://api.github.com/repos/ec-europa/platform-dev/branches{/branch}","tags_url":"https://api.github.com/repos/ec-europa/platform-dev/tags","blobs_url":"https://api.github.com/repos/ec-europa/platform-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ec-europa/platform-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ec-europa/platform-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/ec-europa/platform-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ec-europa/platform-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/ec-europa/platform-dev/languages","stargazers_url":"https://api.github.com/repos/ec-europa/platform-dev/stargazers","contributors_url":"https://api.github.com/repos/ec-europa/platform-dev/contributors","subscribers_url":"https://api.github.com/repos/ec-europa/platform-dev/subscribers","subscription_url":"https://api.github.com/repos/ec-europa/platform-dev/subscription","commits_url":"https://api.github.com/repos/ec-europa/platform-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/ec-europa/platform-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/ec-europa/platform-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/ec-europa/platform-dev/contents/{+path}","compare_url":"https://api.github.com/repos/ec-europa/platform-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ec-europa/platform-dev/merges","archive_url":"https://api.github.com/repos/ec-europa/platform-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ec-europa/platform-dev/downloads","issues_url":"https://api.github.com/repos/ec-europa/platform-dev/issues{/number}","pulls_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/ec-europa/platform-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/ec-europa/platform-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ec-europa/platform-dev/labels{/name}","releases_url":"https://api.github.com/repos/ec-europa/platform-dev/releases{/id}","created_at":"2015-08-31T09:16:12Z","updated_at":"2015-12-10T12:25:26Z","pushed_at":"2015-12-17T08:16:19Z","git_url":"git://github.com/ec-europa/platform-dev.git","ssh_url":"git@github.com:ec-europa/platform-dev.git","clone_url":"https://github.com/ec-europa/platform-dev.git","svn_url":"https://github.com/ec-europa/platform-dev","homepage":null,"size":45515,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":22,"forks":5,"open_issues":22,"watchers":10,"default_branch":"develop"}},"base":{"label":"ec-europa:master","ref":"master","sha":"c9885b7f4d7087a05aa65d505c8d1c0d8c6e3745","user":{"login":"ec-europa","id":10885565,"avatar_url":"https://avatars.githubusercontent.com/u/10885565?v=3","gravatar_id":"","url":"https://api.github.com/users/ec-europa","html_url":"https://github.com/ec-europa","followers_url":"https://api.github.com/users/ec-europa/followers","following_url":"https://api.github.com/users/ec-europa/following{/other_user}","gists_url":"https://api.github.com/users/ec-europa/gists{/gist_id}","starred_url":"https://api.github.com/users/ec-europa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ec-europa/subscriptions","organizations_url":"https://api.github.com/users/ec-europa/orgs","repos_url":"https://api.github.com/users/ec-europa/repos","events_url":"https://api.github.com/users/ec-europa/events{/privacy}","received_events_url":"https://api.github.com/users/ec-europa/received_events","type":"Organization","site_admin":false},"repo":{"id":41666809,"name":"platform-dev","full_name":"ec-europa/platform-dev","owner":{"login":"ec-europa","id":10885565,"avatar_url":"https://avatars.githubusercontent.com/u/10885565?v=3","gravatar_id":"","url":"https://api.github.com/users/ec-europa","html_url":"https://github.com/ec-europa","followers_url":"https://api.github.com/users/ec-europa/followers","following_url":"https://api.github.com/users/ec-europa/following{/other_user}","gists_url":"https://api.github.com/users/ec-europa/gists{/gist_id}","starred_url":"https://api.github.com/users/ec-europa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ec-europa/subscriptions","organizations_url":"https://api.github.com/users/ec-europa/orgs","repos_url":"https://api.github.com/users/ec-europa/repos","events_url":"https://api.github.com/users/ec-europa/events{/privacy}","received_events_url":"https://api.github.com/users/ec-europa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ec-europa/platform-dev","description":"NextEuropa platform","fork":false,"url":"https://api.github.com/repos/ec-europa/platform-dev","forks_url":"https://api.github.com/repos/ec-europa/platform-dev/forks","keys_url":"https://api.github.com/repos/ec-europa/platform-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ec-europa/platform-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ec-europa/platform-dev/teams","hooks_url":"https://api.github.com/repos/ec-europa/platform-dev/hooks","issue_events_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/events{/number}","events_url":"https://api.github.com/repos/ec-europa/platform-dev/events","assignees_url":"https://api.github.com/repos/ec-europa/platform-dev/assignees{/user}","branches_url":"https://api.github.com/repos/ec-europa/platform-dev/branches{/branch}","tags_url":"https://api.github.com/repos/ec-europa/platform-dev/tags","blobs_url":"https://api.github.com/repos/ec-europa/platform-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ec-europa/platform-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ec-europa/platform-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/ec-europa/platform-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ec-europa/platform-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/ec-europa/platform-dev/languages","stargazers_url":"https://api.github.com/repos/ec-europa/platform-dev/stargazers","contributors_url":"https://api.github.com/repos/ec-europa/platform-dev/contributors","subscribers_url":"https://api.github.com/repos/ec-europa/platform-dev/subscribers","subscription_url":"https://api.github.com/repos/ec-europa/platform-dev/subscription","commits_url":"https://api.github.com/repos/ec-europa/platform-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/ec-europa/platform-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/ec-europa/platform-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/ec-europa/platform-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/ec-europa/platform-dev/contents/{+path}","compare_url":"https://api.github.com/repos/ec-europa/platform-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ec-europa/platform-dev/merges","archive_url":"https://api.github.com/repos/ec-europa/platform-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ec-europa/platform-dev/downloads","issues_url":"https://api.github.com/repos/ec-europa/platform-dev/issues{/number}","pulls_url":"https://api.github.com/repos/ec-europa/platform-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/ec-europa/platform-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/ec-europa/platform-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ec-europa/platform-dev/labels{/name}","releases_url":"https://api.github.com/repos/ec-europa/platform-dev/releases{/id}","created_at":"2015-08-31T09:16:12Z","updated_at":"2015-12-10T12:25:26Z","pushed_at":"2015-12-17T08:16:19Z","git_url":"git://github.com/ec-europa/platform-dev.git","ssh_url":"git@github.com:ec-europa/platform-dev.git","clone_url":"https://github.com/ec-europa/platform-dev.git","svn_url":"https://github.com/ec-europa/platform-dev","homepage":null,"size":45515,"stargazers_count":10,"watchers_count":10,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":22,"forks":5,"open_issues":22,"watchers":10,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294"},"html":{"href":"https://github.com/ec-europa/platform-dev/pull/294"},"issue":{"href":"https://api.github.com/repos/ec-europa/platform-dev/issues/294"},"comments":{"href":"https://api.github.com/repos/ec-europa/platform-dev/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ec-europa/platform-dev/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/ec-europa/platform-dev/statuses/4e33e9a8b44fd7b8f2edfc5cde488929686e09eb"}}}}