{"action":"created","issue":{"url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/318","repository_url":"https://api.github.com/repos/sonata-project/SonataCoreBundle","labels_url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/318/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/318/comments","events_url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/318/events","html_url":"https://github.com/sonata-project/SonataCoreBundle/pull/318","id":162434288,"number":318,"title":"added test for AdapterCompilerPass","user":{"login":"ahmetakbn","id":10575905,"avatar_url":"https://avatars.githubusercontent.com/u/10575905?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetakbn","html_url":"https://github.com/ahmetakbn","followers_url":"https://api.github.com/users/ahmetakbn/followers","following_url":"https://api.github.com/users/ahmetakbn/following{/other_user}","gists_url":"https://api.github.com/users/ahmetakbn/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetakbn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetakbn/subscriptions","organizations_url":"https://api.github.com/users/ahmetakbn/orgs","repos_url":"https://api.github.com/users/ahmetakbn/repos","events_url":"https://api.github.com/users/ahmetakbn/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetakbn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/labels/review%20required","name":"review required","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-06-27T11:52:22Z","updated_at":"2016-06-29T15:09:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/pulls/318","html_url":"https://github.com/sonata-project/SonataCoreBundle/pull/318","diff_url":"https://github.com/sonata-project/SonataCoreBundle/pull/318.diff","patch_url":"https://github.com/sonata-project/SonataCoreBundle/pull/318.patch"},"body":"### Subject\r\n\r\nImproving tests for `SonataCoreBundle`"},"comment":{"url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/comments/229386952","html_url":"https://github.com/sonata-project/SonataCoreBundle/pull/318#issuecomment-229386952","issue_url":"https://api.github.com/repos/sonata-project/SonataCoreBundle/issues/318","id":229386952,"user":{"login":"greg0ire","id":657779,"avatar_url":"https://avatars.githubusercontent.com/u/657779?v=3","gravatar_id":"","url":"https://api.github.com/users/greg0ire","html_url":"https://github.com/greg0ire","followers_url":"https://api.github.com/users/greg0ire/followers","following_url":"https://api.github.com/users/greg0ire/following{/other_user}","gists_url":"https://api.github.com/users/greg0ire/gists{/gist_id}","starred_url":"https://api.github.com/users/greg0ire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg0ire/subscriptions","organizations_url":"https://api.github.com/users/greg0ire/orgs","repos_url":"https://api.github.com/users/greg0ire/repos","events_url":"https://api.github.com/users/greg0ire/events{/privacy}","received_events_url":"https://api.github.com/users/greg0ire/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T15:09:49Z","updated_at":"2016-06-29T15:09:49Z","body":"In general, I have come to the realization that writing tests afterwards hardly leads to good tests : have a look at [the tests I wrote for the breadcrumbs builder](https://github.com/sonata-project/SonataAdminBundle/blob/3.x/Tests/Admin/BreadcrumbsBuilderTest.php). They're horrible, because I wrote them to ensure I did not break anything and thus wrote test without refactoring anything in the breadcrumbs builder. Then and only then I extracted the breadcrumbs builder into its own class, and knew it still worked, but… yikes, it's ugly! That's what I want to avoid, but sometimes you have no choice but to follow this process because there were zero tests : \r\n\r\n1. Write tests without refactoring the code.\r\n2. Refactor the code without changing the tests, to make sure you don't break anything.\r\n3. Refactor the tests without changing the code, to make sure you don't break anything.\r\n\r\nDoing TDD, on the other hand, leads to better design from the start, and to clearer and easier to write tests."}}
{"actor":{"display_login":"greg0ire"}}