{"id":2066,"date":"2011-02-24T00:14:54","date_gmt":"2011-02-23T15:14:54","guid":{"rendered":"http:\/\/www.moonmile.net\/blog\/archives\/2066"},"modified":"2011-02-24T00:15:32","modified_gmt":"2011-02-23T15:15:32","slug":"%e3%82%aa%e3%83%ac%e3%82%aa%e3%83%acmvc-%e3%81%ab-phpunit-%e3%82%92%e9%81%a9%e7%94%a8%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/www.moonmile.net\/blog\/archives\/2066","title":{"rendered":"\u30aa\u30ec\u30aa\u30ecmvc \u306b PHPUnit \u3092\u9069\u7528\u3059\u308b"},"content":{"rendered":"<p>\n\u305d\u3093\u306a\u8a33\u3067\u3001\u30aa\u30ec\u30aa\u30ecmvc \u306b PHPUnit \u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\n\u307e\u3001\u30aa\u30ec\u30aa\u30ec mvc \u306f\u3061\u3087\u3063\u3068\u30d1\u30ef\u30fc\u30a2\u30c3\u30d7\u3057\u3066 CakePHP \u98a8\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u3068\u30c7\u30d0\u30c3\u30b0\u8868\u793a\u306b\u3002\n<\/p>\n<p><a href='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2011\/02\/wpid-dworkblogimage20110224_01org.jpg'><img border='0' src='http:\/\/www.moonmile.net\/blog\/wp-content\/uploads\/2011\/02\/wpid-dworkblogimage20110224_01thum.jpg'\/><\/a><\/p>\n<p>\noreoraMVC \u3063\u3066\u3053\u3068\u3067\u3001\u57fa\u672c\u30ab\u30e9\u30fc\u306f\u30aa\u30ec\u30f3\u30b8&#8230;\u3068\u8a00\u3044\u307e\u3059\u304b\u3001\u5b9f\u306f chocolate \u8272\u3002<br \/>\n\u5b9f\u884c\u30af\u30a8\u30ea\u306a\u3093\u304b\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002\n<\/p>\n<p>\n\u30c6\u30b9\u30c8\u30b1\u30fc\u30b9\u306f\u3001\u3053\u3093\u306a\u611f\u3058\u3067\u66f8\u3044\u3066\u3044\u3053\u3046\u304b\u306a\u3068\u3002\n<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\nset_include_path(get_include_path() . PATH_SEPARATOR . &#039;..&#039;);\nrequire_once(&#039;lib\/config.php&#039;);\nrequire_once &#039;controllers\/categories_controller.php&#039;;\n\nclass TestCategoriesController extends PHPUnit_Framework_TestCase\n{\n\tpublic function testNewIndex()\n\t{\n\t\t$controller = new CategoriesController();\n\t\t$controller-&gt;index();\n\t\tglobal $Categories;\n\t\t$this-&gt;assertEquals(19,sizeof($Categories));\n\n\t\t$this-&gt;assertEquals(1,$Categories&#x5B;0]&#x5B;&#039;Category&#039;]&#x5B;&#039;term_id&#039;]);\n\t\t$this-&gt;assertEquals(&amp;quot;blog&amp;quot;,$Categories&#x5B;0]&#x5B;&#039;Category&#039;]&#x5B;&#039;slug&#039;]);\n\t\t$this-&gt;assertEquals(&amp;quot;\u30d6\u30ed\u30b0&amp;quot;,$Categories&#x5B;0]&#x5B;&#039;Category&#039;]&#x5B;&#039;name&#039;]);\n\t}\n}\n?&gt;\n<\/pre>\n<p>\n\u307b\u3089\u3001\u306a\u3093\u304b\u305d\u308c\u3063\u307d\u304f\u306a\u3063\u3066\u3044\u308b\u306e\u304c\u4e0d\u601d\u8b70\u3002oreoreMVC \u306f\u3082\u3046\u3061\u3087\u3063\u3068\u3057\u305f\u3089\u3001\u518d\u5ea6\u516c\u958b\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u3093\u306a\u8a33\u3067\u3001\u30aa\u30ec\u30aa\u30ecmvc \u306b PHPUnit \u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002 \u307e\u3001\u30aa\u30ec\u30aa\u30ec mvc \u306f\u3061\u3087\u3063\u3068\u30d1\u30ef\u30fc\u30a2\u30c3\u30d7\u3057\u3066 CakePHP \u98a8\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u3068\u30c7\u30d0\u30c3\u30b0\u8868\u793a\u306b\u3002 oreoraMVC \u3063\u3066\u3053\u3068\u3067\u3001\u57fa\u672c\u30ab\u30e9\u30fc\u306f\u30aa\u30ec\u30f3\u30b8&#038; &hellip; <a href=\"http:\/\/www.moonmile.net\/blog\/archives\/2066\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,24],"tags":[],"class_list":["post-2066","post","type-post","status-publish","format-standard","hentry","category-cakephp","category-xunit"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/comments?post=2066"}],"version-history":[{"count":1,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2066\/revisions"}],"predecessor-version":[{"id":2067,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/posts\/2066\/revisions\/2067"}],"wp:attachment":[{"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/media?parent=2066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/categories?post=2066"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.moonmile.net\/blog\/wp-json\/wp\/v2\/tags?post=2066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}