{"action":"created","comment":{"url":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/78009958","id":78009958,"diff_hunk":"@@ -649,4 +649,89 @@ public function testDemoMode()\n         $config->set('demo_mode_enabled', 0);\n         $config->set('demo_mode_username', 'wallabag');\n     }\n+\n+    public function testDeleteUserButtonVisibility()\n+    {\n+        $this->logInAs('admin');\n+        $client = $this->getClient();\n+\n+        $crawler = $client->request('GET', '/config');\n+\n+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));\n+        $this->assertContains('config.form_user.delete_account', $body[0]);\n+\n+        $em = $client->getContainer()->get('doctrine.orm.entity_manager');\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('wallace');\n+        $user->setExpired(1);\n+        $em->persist($user);\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('empty');\n+        $user->setExpired(1);\n+        $em->persist($user);\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('bob');\n+        $user->setExpired(1);\n+        $em->persist($user);\n+\n+        $em->flush();\n+\n+        $crawler = $client->request('GET', '/config');\n+\n+        $this->assertGreaterThan(1, $body = $crawler->filter('body')->extract(['_text']));\n+        $this->assertNotContains('config.form_user.delete_account', $body[0]);\n+\n+        $client->request('GET', '/account/delete');\n+        $this->assertEquals(403, $client->getResponse()->getStatusCode());\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('wallace');\n+        $user->setExpired(0);\n+        $em->persist($user);\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('empty');\n+        $user->setExpired(0);\n+        $em->persist($user);\n+\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->findOneByUsername('bob');\n+        $user->setExpired(0);\n+        $em->persist($user);\n+\n+        $em->flush();\n+    }\n+\n+    public function testDeleteAccount()\n+    {\n+        $this->logInAs('wallace');\n+        $client = $this->getClient();\n+\n+        $crawler = $client->request('GET', '/config');\n+\n+        $deleteLink = $crawler->filter('.red')->last()->link();\n+\n+        $client->click($deleteLink);\n+        $this->assertEquals(302, $client->getResponse()->getStatusCode());\n+\n+        $em = $client->getContainer()->get('doctrine.orm.entity_manager');\n+        $user = $em\n+            ->getRepository('WallabagUserBundle:User')\n+            ->createQueryBuilder('u')\n+            ->where('u.username = :username')->setParameter('username', 'wallace')\n+            ->getQuery()\n+            ->getOneOrNullResult()\n+        ;\n+\n+        $this->assertTrue(false !== $user);","path":"tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php","position":87,"original_position":87,"commit_id":"0be843266becd13fa04a3098885efbbd1e4c56a1","original_commit_id":"0be843266becd13fa04a3098885efbbd1e4c56a1","user":{"login":"j0k3r","id":62333,"avatar_url":"https://avatars.githubusercontent.com/u/62333?v=3","gravatar_id":"","url":"https://api.github.com/users/j0k3r","html_url":"https://github.com/j0k3r","followers_url":"https://api.github.com/users/j0k3r/followers","following_url":"https://api.github.com/users/j0k3r/following{/other_user}","gists_url":"https://api.github.com/users/j0k3r/gists{/gist_id}","starred_url":"https://api.github.com/users/j0k3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j0k3r/subscriptions","organizations_url":"https://api.github.com/users/j0k3r/orgs","repos_url":"https://api.github.com/users/j0k3r/repos","events_url":"https://api.github.com/users/j0k3r/events{/privacy}","received_events_url":"https://api.github.com/users/j0k3r/received_events","type":"User","site_admin":false},"body":"`assertNotNull($user)` ?","created_at":"2016-09-08T13:54:34Z","updated_at":"2016-09-08T13:54:34Z","html_url":"https://github.com/wallabag/wallabag/pull/2177#discussion_r78009958","pull_request_url":"https://api.github.com/repos/wallabag/wallabag/pulls/2177","_links":{"self":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/78009958"},"html":{"href":"https://github.com/wallabag/wallabag/pull/2177#discussion_r78009958"},"pull_request":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/2177"}}},"pull_request":{"url":"https://api.github.com/repos/wallabag/wallabag/pulls/2177","id":75227764,"html_url":"https://github.com/wallabag/wallabag/pull/2177","diff_url":"https://github.com/wallabag/wallabag/pull/2177.diff","patch_url":"https://github.com/wallabag/wallabag/pull/2177.patch","issue_url":"https://api.github.com/repos/wallabag/wallabag/issues/2177","number":2177,"state":"open","locked":false,"title":"Delete user","user":{"login":"tcitworld","id":2197836,"avatar_url":"https://avatars.githubusercontent.com/u/2197836?v=3","gravatar_id":"","url":"https://api.github.com/users/tcitworld","html_url":"https://github.com/tcitworld","followers_url":"https://api.github.com/users/tcitworld/followers","following_url":"https://api.github.com/users/tcitworld/following{/other_user}","gists_url":"https://api.github.com/users/tcitworld/gists{/gist_id}","starred_url":"https://api.github.com/users/tcitworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tcitworld/subscriptions","organizations_url":"https://api.github.com/users/tcitworld/orgs","repos_url":"https://api.github.com/users/tcitworld/repos","events_url":"https://api.github.com/users/tcitworld/events{/privacy}","received_events_url":"https://api.github.com/users/tcitworld/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      |no\r\n| New feature?  | yes\r\n| BC breaks?    |no\r\n| Deprecations? |no\r\n| Tests pass?   | yes\r\n| Documentation |no\r\n| Translation   | yes\r\n| Fixed tickets | #1640\r\n| License       | MIT\r\n\r\n","created_at":"2016-06-26T11:39:31Z","updated_at":"2016-09-08T13:54:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"59c8ad44e71aefa0107385cad796465acabad8ca","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/wallabag/wallabag/milestones/27","html_url":"https://github.com/wallabag/wallabag/milestones/2.1.0","labels_url":"https://api.github.com/repos/wallabag/wallabag/milestones/27/labels","id":740140,"number":27,"title":"2.1.0","description":"","creator":{"login":"nicosomb","id":121870,"avatar_url":"https://avatars.githubusercontent.com/u/121870?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosomb","html_url":"https://github.com/nicosomb","followers_url":"https://api.github.com/users/nicosomb/followers","following_url":"https://api.github.com/users/nicosomb/following{/other_user}","gists_url":"https://api.github.com/users/nicosomb/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosomb/subscriptions","organizations_url":"https://api.github.com/users/nicosomb/orgs","repos_url":"https://api.github.com/users/nicosomb/repos","events_url":"https://api.github.com/users/nicosomb/events{/privacy}","received_events_url":"https://api.github.com/users/nicosomb/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":78,"state":"open","created_at":"2014-08-01T19:45:32Z","updated_at":"2016-09-08T10:28:46Z","due_on":"2016-09-24T00:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/wallabag/wallabag/pulls/2177/commits","review_comments_url":"https://api.github.com/repos/wallabag/wallabag/pulls/2177/comments","review_comment_url":"https://api.github.com/repos/wallabag/wallabag/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wallabag/wallabag/issues/2177/comments","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/0be843266becd13fa04a3098885efbbd1e4c56a1","head":{"label":"wallabag:delete-account","ref":"delete-account","sha":"0be843266becd13fa04a3098885efbbd1e4c56a1","user":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"repo":{"id":9193949,"name":"wallabag","full_name":"wallabag/wallabag","owner":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wallabag/wallabag","description":"wallabag is a self hostable application for saving web pages.","fork":false,"url":"https://api.github.com/repos/wallabag/wallabag","forks_url":"https://api.github.com/repos/wallabag/wallabag/forks","keys_url":"https://api.github.com/repos/wallabag/wallabag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallabag/wallabag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallabag/wallabag/teams","hooks_url":"https://api.github.com/repos/wallabag/wallabag/hooks","issue_events_url":"https://api.github.com/repos/wallabag/wallabag/issues/events{/number}","events_url":"https://api.github.com/repos/wallabag/wallabag/events","assignees_url":"https://api.github.com/repos/wallabag/wallabag/assignees{/user}","branches_url":"https://api.github.com/repos/wallabag/wallabag/branches{/branch}","tags_url":"https://api.github.com/repos/wallabag/wallabag/tags","blobs_url":"https://api.github.com/repos/wallabag/wallabag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallabag/wallabag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallabag/wallabag/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallabag/wallabag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/{sha}","languages_url":"https://api.github.com/repos/wallabag/wallabag/languages","stargazers_url":"https://api.github.com/repos/wallabag/wallabag/stargazers","contributors_url":"https://api.github.com/repos/wallabag/wallabag/contributors","subscribers_url":"https://api.github.com/repos/wallabag/wallabag/subscribers","subscription_url":"https://api.github.com/repos/wallabag/wallabag/subscription","commits_url":"https://api.github.com/repos/wallabag/wallabag/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallabag/wallabag/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallabag/wallabag/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallabag/wallabag/issues/comments{/number}","contents_url":"https://api.github.com/repos/wallabag/wallabag/contents/{+path}","compare_url":"https://api.github.com/repos/wallabag/wallabag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallabag/wallabag/merges","archive_url":"https://api.github.com/repos/wallabag/wallabag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallabag/wallabag/downloads","issues_url":"https://api.github.com/repos/wallabag/wallabag/issues{/number}","pulls_url":"https://api.github.com/repos/wallabag/wallabag/pulls{/number}","milestones_url":"https://api.github.com/repos/wallabag/wallabag/milestones{/number}","notifications_url":"https://api.github.com/repos/wallabag/wallabag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallabag/wallabag/labels{/name}","releases_url":"https://api.github.com/repos/wallabag/wallabag/releases{/id}","deployments_url":"https://api.github.com/repos/wallabag/wallabag/deployments","created_at":"2013-04-03T12:21:14Z","updated_at":"2016-09-06T22:37:35Z","pushed_at":"2016-09-08T13:47:09Z","git_url":"git://github.com/wallabag/wallabag.git","ssh_url":"git@github.com:wallabag/wallabag.git","clone_url":"https://github.com/wallabag/wallabag.git","svn_url":"https://github.com/wallabag/wallabag","homepage":"https://www.wallabag.org","size":45832,"stargazers_count":2179,"watchers_count":2179,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":null,"open_issues_count":262,"forks":333,"open_issues":262,"watchers":2179,"default_branch":"master"}},"base":{"label":"wallabag:2.1","ref":"2.1","sha":"5fc79381bb51220836d1c1db4cb5e9c7dec076b9","user":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"repo":{"id":9193949,"name":"wallabag","full_name":"wallabag/wallabag","owner":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wallabag/wallabag","description":"wallabag is a self hostable application for saving web pages.","fork":false,"url":"https://api.github.com/repos/wallabag/wallabag","forks_url":"https://api.github.com/repos/wallabag/wallabag/forks","keys_url":"https://api.github.com/repos/wallabag/wallabag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallabag/wallabag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallabag/wallabag/teams","hooks_url":"https://api.github.com/repos/wallabag/wallabag/hooks","issue_events_url":"https://api.github.com/repos/wallabag/wallabag/issues/events{/number}","events_url":"https://api.github.com/repos/wallabag/wallabag/events","assignees_url":"https://api.github.com/repos/wallabag/wallabag/assignees{/user}","branches_url":"https://api.github.com/repos/wallabag/wallabag/branches{/branch}","tags_url":"https://api.github.com/repos/wallabag/wallabag/tags","blobs_url":"https://api.github.com/repos/wallabag/wallabag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallabag/wallabag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallabag/wallabag/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallabag/wallabag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/{sha}","languages_url":"https://api.github.com/repos/wallabag/wallabag/languages","stargazers_url":"https://api.github.com/repos/wallabag/wallabag/stargazers","contributors_url":"https://api.github.com/repos/wallabag/wallabag/contributors","subscribers_url":"https://api.github.com/repos/wallabag/wallabag/subscribers","subscription_url":"https://api.github.com/repos/wallabag/wallabag/subscription","commits_url":"https://api.github.com/repos/wallabag/wallabag/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallabag/wallabag/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallabag/wallabag/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallabag/wallabag/issues/comments{/number}","contents_url":"https://api.github.com/repos/wallabag/wallabag/contents/{+path}","compare_url":"https://api.github.com/repos/wallabag/wallabag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallabag/wallabag/merges","archive_url":"https://api.github.com/repos/wallabag/wallabag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallabag/wallabag/downloads","issues_url":"https://api.github.com/repos/wallabag/wallabag/issues{/number}","pulls_url":"https://api.github.com/repos/wallabag/wallabag/pulls{/number}","milestones_url":"https://api.github.com/repos/wallabag/wallabag/milestones{/number}","notifications_url":"https://api.github.com/repos/wallabag/wallabag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallabag/wallabag/labels{/name}","releases_url":"https://api.github.com/repos/wallabag/wallabag/releases{/id}","deployments_url":"https://api.github.com/repos/wallabag/wallabag/deployments","created_at":"2013-04-03T12:21:14Z","updated_at":"2016-09-06T22:37:35Z","pushed_at":"2016-09-08T13:47:09Z","git_url":"git://github.com/wallabag/wallabag.git","ssh_url":"git@github.com:wallabag/wallabag.git","clone_url":"https://github.com/wallabag/wallabag.git","svn_url":"https://github.com/wallabag/wallabag","homepage":"https://www.wallabag.org","size":45832,"stargazers_count":2179,"watchers_count":2179,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":333,"mirror_url":null,"open_issues_count":262,"forks":333,"open_issues":262,"watchers":2179,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/2177"},"html":{"href":"https://github.com/wallabag/wallabag/pull/2177"},"issue":{"href":"https://api.github.com/repos/wallabag/wallabag/issues/2177"},"comments":{"href":"https://api.github.com/repos/wallabag/wallabag/issues/2177/comments"},"review_comments":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/2177/comments"},"review_comment":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/2177/commits"},"statuses":{"href":"https://api.github.com/repos/wallabag/wallabag/statuses/0be843266becd13fa04a3098885efbbd1e4c56a1"}}}}
{"actor":{"display_login":"j0k3r"}}