{"_id":"57ffd85f755a2e1700c2bb16","category":{"_id":"57ffd85f755a2e1700c2bb07","project":"567083021dabd80d00b122ae","__v":0,"version":"57ffd85f755a2e1700c2bb05","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-12-18T23:07:56.909Z","from_sync":false,"order":1,"slug":"tutorial","title":"Tutorial"},"parentDoc":null,"user":"567082433a32d20d00c45cab","project":"567083021dabd80d00b122ae","version":{"_id":"57ffd85f755a2e1700c2bb05","project":"567083021dabd80d00b122ae","__v":1,"createdAt":"2016-10-13T18:54:23.018Z","releaseDate":"2016-10-13T18:54:23.018Z","categories":["57ffd85f755a2e1700c2bb06","57ffd85f755a2e1700c2bb07","57ffd85f755a2e1700c2bb08","57ffd85f755a2e1700c2bb09","57ffd85f755a2e1700c2bb0a","57ffd85f755a2e1700c2bb0b","57ffd85f755a2e1700c2bb0c","57ffd85f755a2e1700c2bb0d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"3.4.0","version":"3.4"},"__v":0,"updates":["57f6532fcecf1517001f02d0"],"next":{"pages":[],"description":""},"createdAt":"2015-12-22T22:52:56.182Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"#Test Driven Development\n\nWe start by creating the failing tests that defines the behavior of our new feature\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\nclass CreatePostTest extends TestCase\\n{\\n\\n  public function testStoresPostSuccessfully()\\n  {\\n   \\n    $post = factory(App\\\\Post::class)->make();\\n    \\n    $this->post('/api/posts', [\\n      'name' => $post->name,\\n      'topic' => $post->topic,\\n      ])->seeApiSuccess()\\n      ->seeJsonObject('post')\\n      ->seeJson([\\n        'name' => $post->name,\\n        'topic' => $post->topic,\\n      ]);\\n    \\n    $this->seeInDatabase('posts', [\\n      'name' => $post->name,\\n      'topic' => $post->topic,\\n      ]);\\n  }\\n  \\n}\",\n      \"language\": \"php\",\n      \"name\": \"CreatePostTest.php\"\n    }\n  ]\n}\n[/block]\n> Prefer a screencast?\n[block:html]\n{\n  \"html\": \"<iframe width=\\\"560\\\" height=\\\"315\\\" src=\\\"https://www.youtube.com/embed/_ZWV9KBK2N8\\\" frameborder=\\\"0\\\" allowfullscreen></iframe>\"\n}\n[/block]","excerpt":"","slug":"tdd","type":"basic","title":"TDD"}
#Test Driven Development We start by creating the failing tests that defines the behavior of our new feature [block:code] { "codes": [ { "code": "<?php\n\nclass CreatePostTest extends TestCase\n{\n\n public function testStoresPostSuccessfully()\n {\n \n $post = factory(App\\Post::class)->make();\n \n $this->post('/api/posts', [\n 'name' => $post->name,\n 'topic' => $post->topic,\n ])->seeApiSuccess()\n ->seeJsonObject('post')\n ->seeJson([\n 'name' => $post->name,\n 'topic' => $post->topic,\n ]);\n \n $this->seeInDatabase('posts', [\n 'name' => $post->name,\n 'topic' => $post->topic,\n ]);\n }\n \n}", "language": "php", "name": "CreatePostTest.php" } ] } [/block] > Prefer a screencast? [block:html] { "html": "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/_ZWV9KBK2N8\" frameborder=\"0\" allowfullscreen></iframe>" } [/block]