<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>ヱビスブログ - PHP</title>
    <link>http://thug4dev.com/</link>
    <description>ThugDevLife</description>
    <dc:language>ja</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    <pubDate>Tue, 08 Jul 2008 08:46:18 GMT</pubDate>

    <image>
        <url>http://thug4dev.com/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: ヱビスブログ - PHP - ThugDevLife</title>
        <link>http://thug4dev.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>PHPフツウ</title>
    <link>http://thug4dev.com/index.php?/archives/213-PHP.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/213-PHP.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=213</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=213</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/diary.eth.jp/?date=20080707#p01&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/diary.eth.jp/?date=20080707#p01&#039;]);&quot;  href=&quot;http://diary.eth.jp/?date=20080707#p01&quot;&gt;PHPサイキョウ&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
「rocks」でやった結果。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 10 of about 6,900 for &quot;PHP rocks&quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
なるほど。&lt;br /&gt;
他はどうか。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 10 of about 36,900 for &quot;Ruby rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 8,700 for &quot;Python rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 1,580 for &quot;Perl rocks&quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Ruby 圧倒的過ぎるだろ。&lt;br /&gt;
&lt;br /&gt;
その他。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 10 of about 10,100 for &quot;C++ rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 9,540 for &quot;Java rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 973 for &quot;C# rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 496 for &quot;JavaScript rocks&quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
C++ と Java が大体同じくらいで Python より多い。意外。&lt;br /&gt;
&lt;br /&gt;
ついでに「rules」でもやってみた。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 10 of about 24,000 for &quot;PHP rules&quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
すげえ！これは期待出来る！&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 10 of about 31,700 for &quot;Ruby rules&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 9,690 for &quot;Python rules&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 10 of about 5,570 for &quot;Perl rules&quot;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Ruby 強すぎ。&lt;br /&gt;
&lt;br /&gt;
おまけ。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Results 1 - 2 of 2 for &quot;UnrealScript rocks&quot;&lt;/li&gt;
&lt;li&gt;Results 1 - 3 of 3 for &quot;UnrealScript sucks&quot;&lt;/li&gt;&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Tue, 08 Jul 2008 01:29:03 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/213-guid.html</guid>
    
</item>
<item>
    <title>PHPMock を触ってみた</title>
    <link>http://thug4dev.com/index.php?/archives/212-PHPMock.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/212-PHPMock.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=212</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=212</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    『次世代 Mock Object フレームワークの雄』として一部から熱く注目されている（と思いたい） &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/phpmock/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/phpmock/&#039;]);&quot;  href=&quot;http://code.google.com/p/phpmock/&quot;&gt;PHPMock&lt;/a&gt; ですが、ちょろっとテストコード読んだくらいで触った事が無かったのでトライ。&lt;br /&gt;
&lt;br /&gt;
ちなみに PHPMock のテストコードは PHPSpec で書かれている。個人的には残念な書き味というか、読みやすくない。PHPUnit バンザイ。&lt;br /&gt;
&lt;br /&gt;
ただ PHPUnit の Mock はもうちょっと融通利かせてもらえると有難い。という所で PHPMock はどうか。&lt;br /&gt;
&lt;br /&gt;
Let’s do this.&lt;br /&gt;
&lt;br /&gt;
PHPMock にはまともなドキュメントが一切無い。tgz 玉もないので &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/phpmock/source/checkout&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/phpmock/source/checkout&#039;]);&quot;  href=&quot;http://code.google.com/p/phpmock/source/checkout&quot;&gt;Google Code からチェックアウト&lt;/a&gt;するしかない。specs ディレクトリにテストコードがあるのでこいつを見れば大体の使い方はわかる。test as document を地で行く感じだ。メソッド名は RSpec の mock/stub に似ているというか似せてある。&lt;br /&gt;
&lt;br /&gt;
テストコードはこんな感じ。&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/download/src/phpmock_demo.zip&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/download/src/phpmock_demo.zip&#039;]);&quot;  href=&quot;http://thug4dev.com/src/phpmock_demo.zip&quot;&gt;ダウンロードはこちら。&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
■ test/ProductServiceTest.php&lt;br /&gt;
&lt;pre class=&quot;textmate-source espresso_libre&quot;&gt;&lt;span class=&quot;source source_php source_php_s2php5&quot;&gt;&lt;span class=&quot;source source_php source_php_embedded source_php_embedded_block source_php_embedded_block_html&quot;&gt;&lt;span class=&quot;punctuation punctuation_section punctuation_section_embedded punctuation_section_embedded_begin punctuation_section_embedded_begin_php&quot;&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class=&quot;support support_function support_function_builtin_functions support_function_builtin_functions_php&quot;&gt;define&lt;/span&gt;(&lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;DEMO_ROOT&lt;/span&gt;, &lt;span class=&quot;support support_function support_function_string support_function_string_php&quot;&gt;dirname&lt;/span&gt;(&lt;span class=&quot;support support_function support_function_string support_function_string_php&quot;&gt;dirname&lt;/span&gt;(&lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;&lt;u&gt;_FILE_&lt;/u&gt;&lt;/span&gt;)))&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;meta meta_include meta_include_php&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_import keyword_control_import_include keyword_control_import_include_php&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;DEMO_ROOT&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_string keyword_operator_string_php&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;/phpmock/src/PHPMock.php&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;meta meta_include meta_include_php&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_import keyword_control_import_include keyword_control_import_include_php&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;DEMO_ROOT&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_string keyword_operator_string_php&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_double meta_string-contents_quoted_double_php&quot;&gt;/lib/ProductService.php&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;meta meta_include meta_include_php&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_import keyword_control_import_include keyword_control_import_include_php&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;DEMO_ROOT&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_string keyword_operator_string_php&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;/lib/IDBConnection.php&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;meta meta_include meta_include_php&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_import keyword_control_import_include keyword_control_import_include_php&quot;&gt;require_once&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;DEMO_ROOT&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_string keyword_operator_string_php&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;/lib/Publisher.php&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;meta meta_class meta_class_php&quot;&gt;&lt;span class=&quot;storage storage_type storage_type_class storage_type_class_php&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_type entity_name_type_class entity_name_type_class_php&quot;&gt;ProductServiceTest&lt;/span&gt; &lt;span class=&quot;storage storage_modifier storage_modifier_extends storage_modifier_extends_php&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;entity entity_other entity_other_inherited-class entity_other_inherited-class_php&quot;&gt;PHPUnit_Framework_TestCase&lt;/span&gt;
{&lt;/span&gt;
    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;constant constant_other constant_other_php&quot;&gt;PRODUCT_ID&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;constant constant_numeric constant_numeric_php&quot;&gt;1234&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    
    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;test_プロダクトを全件取得する&lt;/span&gt; ()
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockDb&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_php&quot;&gt;PHPMock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_static meta_function-call_static_php&quot;&gt;mock&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;DBConnection&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockDb&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;shouldReceive&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;)
               &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;withAnyArgs&lt;/span&gt;()
               &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;once&lt;/span&gt;()
               &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;andReturn&lt;/span&gt;(
                 &lt;span class=&quot;meta meta_array meta_array_php&quot;&gt;&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_begin punctuation_definition_array_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_key keyword_operator_key_php&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;NINJA GAIDEN 2&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_end punctuation_definition_array_end_php&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
               )&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;setDBConnection&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockDb&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;assertNotNull&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;getAll&lt;/span&gt;())&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;test_プロダクトIDからパブリッシャの名前を取得する&lt;/span&gt;()
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; 
            &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;createPublisherMock&lt;/span&gt;(&lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_class constant_other_class_php&quot;&gt;PRODUCT_ID&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;setPublisher&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;publisher&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;service&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;meta meta_function-call meta_function-call_php&quot;&gt;getPublisherByProductId&lt;/span&gt;(&lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_class constant_other_class_php&quot;&gt;PRODUCT_ID&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;assertEquals&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;Activision&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;publisher&lt;/span&gt;[&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;])&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;test_クイックモックでfindAllしてみる&lt;/span&gt;()
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_php&quot;&gt;PHPMock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_static meta_function-call_static_php&quot;&gt;mock&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;Publisher&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;, 
                            &lt;span class=&quot;meta meta_array meta_array_php&quot;&gt;&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_begin punctuation_definition_array_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;findAll&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_key keyword_operator_key_php&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;meta meta_array meta_array_php&quot;&gt;&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_begin punctuation_definition_array_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_end punctuation_definition_array_end_php&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_end punctuation_definition_array_end_php&quot;&gt;)&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;findAll&lt;/span&gt;()&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;assertTrue&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;verify&lt;/span&gt;())&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;test_引数がマッチしなければ例外を投げる&lt;/span&gt;()
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; 
            &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;createPublisherMock&lt;/span&gt;(&lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;self&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;constant constant_other constant_other_class constant_other_class_php&quot;&gt;PRODUCT_ID&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;keyword keyword_control keyword_control_exception keyword_control_exception_php&quot;&gt;try&lt;/span&gt; {
            &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mockPublisher&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;findByProductId&lt;/span&gt;(&lt;span class=&quot;constant constant_numeric constant_numeric_php&quot;&gt;9999&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        } &lt;span class=&quot;meta meta_catch meta_catch_php&quot;&gt;&lt;span class=&quot;keyword keyword_control keyword_control_exception keyword_control_exception_php&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;support support_class support_class_php&quot;&gt;Exception&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;e&lt;/span&gt;)&lt;/span&gt; {
            &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        }
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;fail&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_double meta_string-contents_quoted_double_php&quot;&gt;An expected exception has not been raised.&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;test_PHPUnitのMockObjectはこんな感じ&lt;/span&gt;()
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;getMock&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;DBConnection&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;, 
                &lt;span class=&quot;meta meta_array meta_array_php&quot;&gt;&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_begin punctuation_definition_array_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;preparedStatement&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_end punctuation_definition_array_end_php&quot;&gt;)&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;expects&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;once&lt;/span&gt;())
             &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;method&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;execute&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;)
             &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;will&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;returnValue&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;aaaa&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;))&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;assertEquals&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;aaaa&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;execute&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_double string_quoted_double_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_double meta_string-contents_quoted_double_php&quot;&gt;sql statement&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;))&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

&lt;span class=&quot;meta meta_function meta_function_php&quot;&gt;    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public &lt;/span&gt;&lt;span class=&quot;storage storage_type storage_type_function storage_type_function_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;createPublisherMock&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;meta meta_function meta_function_arguments meta_function_arguments_php&quot;&gt;&lt;span class=&quot;meta meta_function meta_function_argument meta_function_argument_no-default meta_function_argument_no-default_php&quot;&gt;&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;productId&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;support support_class support_class_php&quot;&gt;PHPMock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_static meta_function-call_static_php&quot;&gt;mock&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;Publisher&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;)&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;shouldReceive&lt;/span&gt;(&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;findByProductId&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;)
             &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;with&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;productId&lt;/span&gt;)
             &lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;meta meta_function-call meta_function-call_object meta_function-call_object_php&quot;&gt;andReturn&lt;/span&gt;(
                 &lt;span class=&quot;meta meta_array meta_array_php&quot;&gt;&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_begin punctuation_definition_array_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_key keyword_operator_key_php&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;string string_quoted string_quoted_single string_quoted_single_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php&quot;&gt;&#039;&lt;/span&gt;&lt;span class=&quot;meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php&quot;&gt;Activision&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php&quot;&gt;&#039;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_array punctuation_definition_array_end punctuation_definition_array_end_php&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
             )&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;   
        &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;mock&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

&lt;span class=&quot;meta meta_function meta_function_php&quot;&gt;    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public &lt;/span&gt;&lt;span class=&quot;storage storage_type storage_type_function storage_type_function_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;setUp&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_php&quot;&gt;(&lt;/span&gt;)&lt;/span&gt;
    {
        &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;service&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;keyword keyword_other keyword_other_new keyword_other_new_php&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;support support_class support_class_php&quot;&gt;ProductService&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }

&lt;span class=&quot;meta meta_function meta_function_php&quot;&gt;    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public &lt;/span&gt;&lt;span class=&quot;storage storage_type storage_type_function storage_type_function_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;tearDown&lt;/span&gt; &lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_php&quot;&gt;(&lt;/span&gt;)&lt;/span&gt;
    {
    }
}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
で、このコードは実行すると「test_引数がマッチしなければ例外を投げる」でコケる。&lt;br /&gt;
PHPMock_Expectation#matchArgs に問題があって&lt;br /&gt;
&lt;br /&gt;
■ phpmock/src/PHPMock/Expectation/Expectation.php&lt;br /&gt;
&lt;pre class=&quot;textmate-source espresso_libre&quot;&gt;&lt;span class=&quot;meta meta_function meta_function_php&quot;&gt;    &lt;span class=&quot;storage storage_modifier storage_modifier_php&quot;&gt;public &lt;/span&gt;&lt;span class=&quot;storage storage_type storage_type_function storage_type_function_php&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;entity entity_name entity_name_function entity_name_function_php&quot;&gt;matchArgs&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_parameters punctuation_definition_parameters_begin punctuation_definition_parameters_begin_php&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;meta meta_function meta_function_arguments meta_function_arguments_php&quot;&gt;&lt;span class=&quot;meta meta_function meta_function_argument meta_function_argument_array meta_function_argument_array_php&quot;&gt;&lt;span class=&quot;storage storage_type storage_type_php&quot;&gt;array&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;args&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;)&lt;/span&gt;
    {
        &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;empty&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;args&lt;/span&gt;) &lt;span class=&quot;keyword keyword_operator keyword_operator_logical keyword_operator_logical_php&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;empty&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;_expectedArgs&lt;/span&gt;) &lt;span class=&quot;keyword keyword_operator keyword_operator_logical keyword_operator_logical_php&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;support support_function support_function_type support_function_type_php&quot;&gt;is_array&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;_expectedArgs&lt;/span&gt;)) {
            &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        } &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;elseif&lt;/span&gt; (&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;args&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_php&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;_expectedArgs&lt;/span&gt;) {
            &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        } &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;elseif&lt;/span&gt; (&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;_expectedArgs&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_php&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;true&lt;/span&gt;) {
            &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        } &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;elseif&lt;/span&gt; (&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;this&lt;/span&gt;&lt;span class=&quot;keyword keyword_operator keyword_operator_class keyword_operator_class_php&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;variable variable_other variable_other_property variable_other_property_php&quot;&gt;_expectedArgs&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_php&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;keyword keyword_operator keyword_operator_logical keyword_operator_logical_php&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;support support_function support_function_construct support_function_construct_php&quot;&gt;empty&lt;/span&gt;(&lt;span class=&quot;variable variable_other variable_other_php&quot;&gt;&lt;span class=&quot;punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php&quot;&gt;$&lt;/span&gt;args&lt;/span&gt;)) {
            &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
        }  
        &lt;span class=&quot;keyword keyword_control keyword_control_php&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;constant constant_language constant_language_php&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php&quot;&gt;;&lt;/span&gt;
    }&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
「$this-&gt;_expectedArgs &lt;strong&gt;==&lt;/strong&gt; true」これだと $this-&gt;_expectedArgs に値が入ってれば true になっちゃうという良く話題になるアレです。正解は「$this-&gt;_expectedArgs &lt;strong&gt;===&lt;/strong&gt; true」これですな。&lt;br /&gt;
&lt;br /&gt;
上のコードで使っている DBConnection はインターフェースで Publisher は空っぽのクラス。&lt;br /&gt;
インターフェースに定義されているメソッドは PHPMock#_generateDefForMethods がよしなに実装してくれるので安心。PHPUnit の Mock Object だと定義したメソッドをイチイチ配列で全部ツッコまないといけない。&lt;br /&gt;
&lt;br /&gt;
いわゆるスタブは無くて shouldReceive 一本になると思われる。&lt;br /&gt;
PHPMock#mock の第二引数に array($methodName =&gt; $returnValue) を与える事で簡単にモックが作れるのは好感。&lt;br /&gt;
&lt;br /&gt;
■ まとめ&lt;br /&gt;
	&lt;ul&gt;
	&lt;li&gt;まだまだ挙動が怪しい点はある&lt;/li&gt;
		&lt;li&gt;それでも &lt;span class=&quot;caps&quot;&gt;PHP&lt;/span&gt;Unit の mock よりは楽できる&lt;/li&gt;

		&lt;li&gt;テストコード内でザクザクモック作りたいなら MockInterceptor よりオススメ&lt;/li&gt;
	&lt;/ul&gt; 
    </content:encoded>

    <pubDate>Mon, 23 Jun 2008 20:37:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/212-guid.html</guid>
    
</item>
<item>
    <title>炎上必至のフレームワーク</title>
    <link>http://thug4dev.com/index.php?/archives/209-unknown.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/209-unknown.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=209</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=209</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    &lt;div class=&quot;thumbnail&quot;&gt;&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/skitch.com/kiyoshiyoshida/khug/ts3a0012&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/skitch.com/kiyoshiyoshida/khug/ts3a0012&#039;]);&quot;  href=&quot;http://skitch.com/kiyoshiyoshida/khug/ts3a0012&quot;&gt;&lt;img src=&quot;http://img.skitch.com/20080506-tgm1djku5d9np3kbre8ensdej5.preview.jpg&quot; alt=&quot;TS3A0012&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080&quot;&gt;Uploaded with &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/plasq.com/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/plasq.com/&#039;]);&quot;  href=&quot;http://plasq.com/&quot;&gt;plasq&lt;/a&gt;&#039;s &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/skitch.com&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/skitch.com&#039;]);&quot;  href=&quot;http://skitch.com&quot;&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt; 
    </content:encoded>

    <pubDate>Tue, 06 May 2008 17:03:17 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/209-guid.html</guid>
    
</item>
<item>
    <title>しょーもないPHPプログラマにありがちな40の兆候</title>
    <link>http://thug4dev.com/index.php?/archives/205-PHP40.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/205-PHP40.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=205</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=205</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    ザラッと訳してみる&lt;br /&gt;
元々がちょっと変な所は手を入れてます。なんだか良く判らんのは原文残してます。添削してつかあさい。&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/reinholdweber.com/?p=19&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/reinholdweber.com/?p=19&#039;]);&quot;  href=&quot;http://reinholdweber.com/?p=19&quot;&gt;40 signs you really are a lousy PHP programmer &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;phpDoc 等でコードにコメントを入れない&lt;/li&gt;
&lt;li&gt;Zend Studio や Eclipse PDT の様な IDE の恩恵に目を向けない&lt;/li&gt;
&lt;li&gt;Subversion 等のバージョン管理ツールを使おうとしない&lt;/li&gt;
&lt;li&gt;プロジェクトにて、コーディング・命名規約や共通の規約を設けない&lt;/li&gt;
&lt;li&gt;一貫性の有る手順を設けない&lt;/li&gt;
&lt;li&gt;入力値や SQL クエリのエスケープ、検証をしない&lt;/li&gt;
&lt;li&gt;コードを書く前にアプリケーション全体の計画をしない&lt;/li&gt;
&lt;li&gt;テスト駆動開発を行わない&lt;/li&gt;
&lt;li&gt;error_reporting を on にしないで開発、テストをする&lt;/li&gt;
&lt;li&gt;デバッガの恩恵に目を向けない&lt;/li&gt;
&lt;li&gt;リファクタリングをしない&lt;/li&gt;
&lt;li&gt;MVC の様にレイヤーの切り分けを維持しようとしない&lt;/li&gt;
&lt;li&gt;これらの略語の意味を知らない：KISS, DRY, MVC, OOP, REST&lt;/li&gt;
&lt;li&gt;関数やクラスがデータを返さずに、直接 print や echo をする&lt;/li&gt;
&lt;li&gt;ユニットテストや一般的なテスティングの利点に目を向けた事が無い&lt;/li&gt;
&lt;li&gt;データや文字列やオブジェクトではなく、HTML を return する&lt;/li&gt;
&lt;li&gt;メッセージや設定パラメータをハードコードする&lt;/li&gt;
&lt;li&gt;SQL クエリの最適化をしない&lt;/li&gt;
&lt;li&gt;__autoload 関数を使わない&lt;/li&gt;
&lt;li&gt;エラーをスマートに扱わない（don&#039;t allow intelligent error handling）&lt;/li&gt;
&lt;li&gt;$_POST を使わずに何でも $_GET にしてしまう&lt;/li&gt;
&lt;li&gt;正規表現をどう使えばいいか知らない&lt;/li&gt;
&lt;li&gt;SQL インジェクションやクロスサイトスクリプティングという言葉を聞いた事が無い&lt;/li&gt;
&lt;li&gt;設定をシンプルにしない → クラスのコンストラクタでパラメータを受けたり、セッタ・ゲッタを呼び出したり、実行時に定義する事が出来る&lt;/li&gt;
&lt;li&gt;オブジェクト指向プログラミングの利点と制限を理解していない&lt;/li&gt;
&lt;li&gt;OOP の誤用。どんなに小さな物でも OOP で書いてしまう。&lt;/li&gt;
&lt;li&gt;再利用出来るソフトウェアは OOP じゃないと駄目だ、と思っている&lt;/li&gt;
&lt;li&gt;理にかなったデフォルト設定をしない（don&#039;t choose intelligent defaults）&lt;/li&gt;
&lt;li&gt;設定ファイルがひとつじゃない&lt;/li&gt;
&lt;li&gt;ファイルの中身が見えるようにせず、拡張子を .php の替わりに .inc にする（don&#039;t want the file contents to be seen, but give it a .inc extension instead of .php）&lt;/li&gt;
&lt;li&gt;データベース抽象レイヤを使わない&lt;/li&gt;
&lt;li&gt;DRY 原則を守らない → コピペや重複を避けた方がいい&lt;/li&gt;
&lt;li&gt;関数 / クラス / メソッドの責務を一つに絞らず、相互作用するように作らない&lt;/li&gt;
&lt;li&gt;abstract/interface クラスや、ポリモーフィズム、アクセス修飾子等の OOP の利点を得ようとしていない&lt;/li&gt;
&lt;li&gt;デザインパターンを使ってアプリケーション設計の最適化をしない&lt;/li&gt;
&lt;li&gt;複数のファイルやディレクトリが必要なアプリケーションで、ベースディレクトリの定義をしない&lt;/li&gt;
&lt;li&gt;グローバルネームスペースを汚染する → ライブラリに共通の文字列をプレフィックスとして付ける方法がある&lt;/li&gt;
&lt;li&gt;DB のテーブルにプレフィックスをつけさせない&lt;/li&gt;
&lt;li&gt;別々のテンプレートエンジンを使う&lt;/li&gt;
&lt;li&gt;ウェブ開発のコンセプトに長けており、コードのキレイな PHP フレームワークに注目していない&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
PHP に直接関係無い項目もありますね。&lt;br /&gt;
素直に納得出来る項目もあれば、場面ってのも。&lt;br /&gt;
場面ってのはそれが有効に作用するケースもあるだろう事を知っていないといかんのですけど。 
    </content:encoded>

    <pubDate>Tue, 05 Feb 2008 20:04:21 -0800</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/205-guid.html</guid>
    
</item>
<item>
    <title>Hamcrest で PHPUnit の assertion を読みやすくする</title>
    <link>http://thug4dev.com/index.php?/archives/203-Hamcrest-PHPUnit-assertion.html</link>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/203-Hamcrest-PHPUnit-assertion.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=203</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=203</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    セバスチャンがまた面白そうな事やってます。&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/sebastian-bergmann.de/archives/733-Hamcrest.html&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/sebastian-bergmann.de/archives/733-Hamcrest.html&#039;]);&quot;  href=&quot;http://sebastian-bergmann.de/archives/733-Hamcrest.html&quot;&gt;Hamcrest&lt;/a&gt;&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/sebastian-bergmann.de/archives/735-Getting-Started-with-Hamcrest.html&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/sebastian-bergmann.de/archives/735-Getting-Started-with-Hamcrest.html&#039;]);&quot;  href=&quot;http://sebastian-bergmann.de/archives/735-Getting-Started-with-Hamcrest.html&quot;&gt;Getting Started with Hamcrest&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/hamcrest/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/code.google.com/p/hamcrest/&#039;]);&quot;  href=&quot;http://code.google.com/p/hamcrest/&quot;&gt;Hamcrest&lt;/a&gt; という matcher 拡張ライブラリ。&lt;br /&gt;
厳密には拡張ではないのか。「テスト表現を宣言的にしていこうぜライブラリ」のが近い？&lt;br /&gt;
&lt;br /&gt;
Java と .Net 向けにあったものをセバスチャンが PHP にポーティング中。&lt;br /&gt;
リポジトリも本家にあります。&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/hamcrest.googlecode.com/svn/trunk/hamcrest-php/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/hamcrest.googlecode.com/svn/trunk/hamcrest-php/&#039;]);&quot;  href=&quot;http://hamcrest.googlecode.com/svn/trunk/hamcrest-php/&quot;&gt;http://hamcrest.googlecode.com/svn/trunk/hamcrest-php/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
早速チェックアウトして使ってみました。&lt;br /&gt;
Let&#039;s do this. &lt;br /&gt;&lt;a href=&quot;http://thug4dev.com/index.php?/archives/203-Hamcrest-PHPUnit-assertion.html#extended&quot;&gt;&quot;Hamcrest で PHPUnit の assertion を読みやすくする&quot; の続きを読む...&lt;/a&gt;
    </content:encoded>

    <pubDate>Wed, 09 Jan 2008 21:49:00 -0800</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/203-guid.html</guid>
    
</item>
<item>
    <title>S2Base.PHP5-2.0.0RC2 出てます</title>
    <link>http://thug4dev.com/index.php?/archives/198-S2Base.PHP5-2.0.0RC2.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/198-S2Base.PHP5-2.0.0RC2.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=198</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=198</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    でますた。&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/s2base.php5.sandbox.seasar.org/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/s2base.php5.sandbox.seasar.org/&#039;]);&quot;  href=&quot;http://s2base.php5.sandbox.seasar.org/&quot;&gt;http://s2base.php5.sandbox.seasar.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
主な変更点&lt;br /&gt;
・goya コマンドを service &amp;amp; dao に変更&lt;br /&gt;
・with Symfony の追加&lt;br /&gt;
・with Zf に functional test を追加&lt;br /&gt;
・Symfony のプラグインとしてインストールする sfS2BasePlugin を新規追加&lt;br /&gt;
&lt;br /&gt;
Zf の functional test はもうちょいどうにかしたいと思いつつも、今のところ大して不便もしてない事実。&lt;br /&gt;
&lt;br /&gt;
mock/stub のセットアップがちょっと面倒なくらいか。&lt;br /&gt;
あれはなんとかしたい。&lt;br /&gt;
&lt;br /&gt;
フィードバックお待ちしてます。 
    </content:encoded>

    <pubDate>Mon, 17 Dec 2007 01:35:52 -0800</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/198-guid.html</guid>
    
</item>
<item>
    <title>Keynote から書き出した PDF にメタデータを追加する</title>
    <link>http://thug4dev.com/index.php?/archives/192-Keynote-PDF.html</link>
            <category>Mac</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/192-Keynote-PDF.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=192</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=192</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    ちょっと気になったので調べてみる。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;Keynoteで書き出すPDFにメタ情報つけんのどうやんの？；；&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/twitter.com/yonekawa/statuses/392801632&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/twitter.com/yonekawa/statuses/392801632&#039;]);&quot;  href=&quot;http://twitter.com/yonekawa/statuses/392801632&quot;&gt;http://twitter.com/yonekawa/statuses/392801632&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
この手のメタデータ・拡張属性埋め込みツールみたいのがありそうなもんだが、3分探して見つからなかったので代替策を考える。Leopard なら xattr でいけそうな気もするが MacBook が見事に入院中なので試せない。&lt;br /&gt;
&lt;br /&gt;
とりあえず mdls してみる。 &lt;br /&gt;&lt;a href=&quot;http://thug4dev.com/index.php?/archives/192-Keynote-PDF.html#extended&quot;&gt;&quot;Keynote から書き出した PDF にメタデータを追加する&quot; の続きを読む...&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 27 Nov 2007 16:07:06 -0800</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/192-guid.html</guid>
    
</item>
<item>
    <title>Standard PHP Library (SPL) という選択肢</title>
    <link>http://thug4dev.com/index.php?/archives/189-Standard-PHP-Library-SPL.html</link>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/189-Standard-PHP-Library-SPL.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=189</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=189</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    例えば、SPLを使う。&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/php.net/spl&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/php.net/spl&#039;]);&quot;  href=&quot;http://php.net/spl&quot;&gt;PHP: Standard PHP Library (SPL) 関数 - Manual&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;いろいろ調べてみたけど、統一的なやりかた？みたいなのができなくてうまく書けない（；＿；）&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/jknaoya/20071112/1194888681&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/jknaoya/20071112/1194888681&#039;]);&quot;  href=&quot;http://d.hatena.ne.jp/jknaoya/20071112/1194888681&quot;&gt;PHP を少しだけ触ってみました＞＜ - 女子高生ぷろぐらまーなお☆のブログ&lt;/a&gt;&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
イテレータ系はSPL使うと便利になる。&lt;br /&gt;
というかイテレータばかりなので存在が地味なのが惜しい。&lt;br /&gt;
&lt;pre&gt;
function getFilenames($path)
{
    $ret = array();
    $r_ite = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
    foreach ($r_ite as $ite) {
        $ret[] = $ite-&gt;getRealPath();
    }
    return $ret;
}

var_dump(getFilenames(dirname(&lt;u&gt;_FILE_&lt;/u&gt;)));&lt;/pre&gt;&lt;br /&gt;
再帰処理もよしなにやってくれるのでスッキリする。&lt;br /&gt;
&lt;strong&gt;RecursiveIteratorIterator&lt;/strong&gt; というわかりやすさを優先しすぎたクラス名に目をつぶれば。&lt;br /&gt;
&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Sat, 17 Nov 2007 03:43:00 -0800</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/189-guid.html</guid>
    
</item>
<item>
    <title>Zend_DbとSQLファイル</title>
    <link>http://thug4dev.com/index.php?/archives/185-Zend_DbSQL.html</link>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/185-Zend_DbSQL.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=185</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=185</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    Zend_Dbを拡張してSQLファイルを扱えるようにしてみてはどうか。&lt;br /&gt;
S2JDBCっぽくなるんじゃないか。&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
来月出張で中国行くんですが、オープンチケット。&lt;br /&gt;
現地でのジョブが終わり次第帰国。&lt;br /&gt;
&lt;br /&gt;
成田からSeasarConfに直行とかにならないように頑張ります。&lt;br /&gt;
 
    </content:encoded>

    <pubDate>Tue, 30 Oct 2007 20:24:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/185-guid.html</guid>
    
</item>
<item>
    <title>Tiger→Leopard移行</title>
    <link>http://thug4dev.com/index.php?/archives/183-TigerLeopard.html</link>
            <category>Mac</category>
            <category>PHP</category>
            <category>RoR</category>
    
    <comments>http://thug4dev.com/index.php?/archives/183-TigerLeopard.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=183</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=183</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    早速MacBookにLeopardをブッコみました。&lt;br /&gt;
過去、上書きインストールすると何かと問題が起きていたので&lt;strong&gt;「クリーンインストール&amp;移行アシスタント」&lt;/strong&gt;を組み合わせます。&lt;br /&gt;
&lt;br /&gt;
1. 外付けHDDをつなぐ&lt;br /&gt;
2. インストールDVDを入れて10.5のインストールモードにする（再起動）&lt;br /&gt;
3. ディスクユーティリティでMacBookのHDDをイメージ化して外付けHDDにバックアップ&lt;br /&gt;
4. クリーンインストール（新規アカウントのユーザー名は旧アカウントと被らないように注意）&lt;br /&gt;
5. インストール終了後、HDDに移したイメージをマウント&lt;br /&gt;
6. 移行アシスタントの「別のボリュームから」を選択&lt;br /&gt;
7. 移行するアカウントを選択して移行開始&lt;br /&gt;
8. 終わったら移行したアカウントでログイン&lt;br /&gt;
9. インストール時に作ったアカウントを削除&lt;br /&gt;
10. XcodeToolsのインストール&lt;br /&gt;
&lt;br /&gt;
すげーラク。&lt;br /&gt;
アプリケーションや書類の他に、ホームディレクトリも移行されます。&lt;br /&gt;
MacBookには何故かsvkを入れてなかったのですが、多分その辺もちゃんと移行されるはず。&lt;br /&gt;
zshrc等はいけてます。&lt;br /&gt;
&lt;br /&gt;
後は各アプリケーションのLeopard対応アップデータを当てていく感じになる。&lt;br /&gt;
&lt;br /&gt;
MacPorts周りも移行されますが、&lt;br /&gt;
Leopard自体が割と開発者フレンドリーな作りになってたので構成を変更する予定。&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;【補足】&lt;/strong&gt;&lt;br /&gt;
/Library/LaunchDaemons 以下は移行されてないのでactivateし直す必要アリ&lt;br /&gt;
&lt;br /&gt;
デフォルトがこんな感じだった。&lt;br /&gt;
&lt;br /&gt;
zsh 4.3.4&lt;br /&gt;
subversion 1.4.4&lt;br /&gt;
svk 2.0.1&lt;br /&gt;
Ruby 1.8.6&lt;br /&gt;
rake 0.7.3&lt;br /&gt;
rubygems 0.9.4&lt;br /&gt;
Rails 1.2.3&lt;br /&gt;
mongrel 1.0.1&lt;br /&gt;
capistrano 2.0.0&lt;br /&gt;
PHP 5.2.4&lt;br /&gt;
maven 2.0.6&lt;br /&gt;
&lt;br /&gt;
Ruby方面が力強いなー。&lt;br /&gt;
svkがデフォなのはアツい！&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
やっとPHP5になったー、と思ったらpearが入ってねー。&lt;br /&gt;
PHPはMacPortsにしとく。 
    </content:encoded>

    <pubDate>Sat, 27 Oct 2007 02:31:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/183-guid.html</guid>
    
</item>
<item>
    <title>gihyo.jpのPHPUnit3特集がアツすぎる</title>
    <link>http://thug4dev.com/index.php?/archives/178-gihyo.jpPHPUnit3.html</link>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/178-gihyo.jpPHPUnit3.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=178</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=178</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/shimooka/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/shimooka/&#039;]);&quot;  href=&quot;http://d.hatena.ne.jp/shimooka/&quot;&gt;id:shimookaさん&lt;/a&gt;によるPHPUnit3特集！&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;br /&gt;
gihyo.jpにPHPUnitネタで特集を書きました。本日公開です。&lt;br /&gt;
&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/shimooka/20071002/1191304335&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/d.hatena.ne.jp/shimooka/20071002/1191304335&#039;]);&quot;  href=&quot;http://d.hatena.ne.jp/shimooka/20071002/1191304335&quot;&gt;Do You PHP はてな - gihyo.jpに特集書きました&lt;/a&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/gihyo.jp/dev/feature/01/php-test/0001&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/gihyo.jp/dev/feature/01/php-test/0001&#039;]);&quot;  href=&quot;http://gihyo.jp/dev/feature/01/php-test/0001&quot;&gt;PHPUnit3で始めるユニットテスト：第1回　PHPUnit入門｜gihyo.jp&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
初回はザラっとPHPUnitの紹介と使い方、TDDについて。&lt;br /&gt;
次回以降はショッピングカートクラスを（TDDで？）実装していくそうな。&lt;br /&gt;
&lt;br /&gt;
gihyo.jpっていつのまにかWeb連載的な事をやってますね。 
    </content:encoded>

    <pubDate>Tue, 02 Oct 2007 15:23:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/178-guid.html</guid>
    
</item>
<item>
    <title>PHPUnitの結果出力を色付けする</title>
    <link>http://thug4dev.com/index.php?/archives/177-PHPUnit.html</link>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/177-PHPUnit.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=177</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=177</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    多分２万人くらいが通ってる道。&lt;br /&gt;
&lt;a href=&quot;http://thug4dev.com/index.php?/archives/174-stakeout.rbPHPUnitautotest.html&quot;&gt;autotestモドキ&lt;/a&gt;を使ってると色ついてた方がいいなー、と。&lt;br /&gt;
&lt;br /&gt;
てかPHPUnit2くらいの頃は色付け出来たような気がするんだけど、記憶違い？&lt;br /&gt;
tracあさってたら&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/phpunit.de/ticket/39&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/phpunit.de/ticket/39&#039;]);&quot;  href=&quot;http://phpunit.de/ticket/39&quot;&gt;力一杯wontfixになってて&lt;/a&gt;、ソース見てもそれっぽい部分は無いしやっぱり未実装か。&lt;br /&gt;
&lt;br /&gt;
セバスチャンに会ったら説教だな。&lt;br /&gt;
&lt;br /&gt;
色付けにはpearの&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/pear.php.net/package/Console_Color&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/pear.php.net/package/Console_Color&#039;]);&quot;  href=&quot;http://pear.php.net/package/Console_Color&quot;&gt;Console_Color&lt;/a&gt;を使ってます。便利！&lt;br /&gt;
Windowsだと色付けしてくれないと思うけど。&lt;br /&gt;
 &lt;br /&gt;&lt;a href=&quot;http://thug4dev.com/index.php?/archives/177-PHPUnit.html#extended&quot;&gt;&quot;PHPUnitの結果出力を色付けする&quot; の続きを読む...&lt;/a&gt;
    </content:encoded>

    <pubDate>Tue, 25 Sep 2007 01:36:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/177-guid.html</guid>
    
</item>
<item>
    <title>stakeout.rbを使ってPHPUnitのautotest</title>
    <link>http://thug4dev.com/index.php?/archives/174-stakeout.rbPHPUnitautotest.html</link>
            <category>PHP</category>
            <category>TextMate</category>
    
    <comments>http://thug4dev.com/index.php?/archives/174-stakeout.rbPHPUnitautotest.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=174</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=174</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    &lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/www.zenspider.com/ZSS/Products/ZenTest/&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/www.zenspider.com/ZSS/Products/ZenTest/&#039;]);&quot;  href=&quot;http://www.zenspider.com/ZSS/Products/ZenTest/&quot;&gt;autotest&lt;/a&gt;の素晴らしさが最近になってようやくわかって来ました。&lt;br /&gt;
ぶっちゃけ最初はうぜえとか思ってたんですけども。「⌘Rするからいらんわい」みたいな感じ。&lt;br /&gt;
&lt;br /&gt;
しかしながら&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/macromates.com/textmate/manual/commands#changing_output_type&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/macromates.com/textmate/manual/commands#changing_output_type&#039;]);&quot;  href=&quot;http://macromates.com/textmate/manual/commands#changing_output_type&quot;&gt;Show as HTML&lt;/a&gt;は意外と実行コストが高く、こまめにフィードバックが欲しい時は結構なストレスになります。そういう時に裏側でスルスル走ってくれてると嬉しい。&lt;br /&gt;
&lt;br /&gt;
特にautotestとRSpecの組み合わせが気持ち良い。dustと組み合わせても良し。&lt;br /&gt;
&lt;br /&gt;
とはいえSpecMateのカッコ良さは異常（&lt;a href=&quot;http://thug4dev.com/mov/TextMate_SpecMate.mov&quot;&gt;QuickTime 4.9MB&lt;/a&gt;）なので常にautotestってわけじゃ無いんですけど。場面で。&lt;br /&gt;
&lt;br /&gt;
さて。&lt;br /&gt;
&lt;br /&gt;
BDDフレームワークはともかくautotestの仕組みはPHPUnitで使いたいと思っていた所、ちょっと楽しそうなエントリを発見。&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/mikenaberezny.com/archives/78&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/mikenaberezny.com/archives/78&#039;]);&quot;  href=&quot;http://mikenaberezny.com/archives/78&quot;&gt;Mike Naberezny – Faster TDD with Stakeout.rb&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Pragmatic Automationでstakeout.rbという「ファイルの変更を検知してコマンドを実行」してくれるスクリプトが紹介されております。&lt;br /&gt;
&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc&#039;]);&quot;  href=&quot;http://www.pragmaticautomation.com/cgi-bin/pragauto.cgi/Monitor/StakingOutFileChanges.rdoc&quot;&gt;Pragmatic Automation – Staking Out File Changes&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
これを使えばRuby以外でもautotestっぽく出来るよー、っちゅーことみたいです。&lt;br /&gt;
早速やってみた。&lt;br /&gt;
&lt;br /&gt;
■実行コマンド&lt;br /&gt;
&lt;pre&gt;% ruby stakeout.rb “php AllTests.php” */**&lt;/pre&gt;&lt;br /&gt;
適当にファイルを修正して保存するとコンソールでランナーが走る。&lt;br /&gt;
&lt;br /&gt;
すげー簡単。&lt;br /&gt;
stakeout.rbのコードが短すぎてお漏らししそう！&lt;br /&gt;
&lt;br /&gt;
一応サンプルのソース → &lt;a href=&quot;http://thug4dev.com/src/phpunit_autotest.tar.gz&quot;&gt;phpunit_autotest.tar.gz&lt;/a&gt;&lt;br /&gt;
S2ContainerClassLoader使ってるのでS2Container.PHP5必須です。AllTests.phpは現在S2Base.PHP5のtrunkに入っているS2Base_Cli_AbstractCommandHandlerからテスト実行部分だけ抜き出したもの。&lt;br /&gt;
&lt;br /&gt;
コイツをstakeout.rbに埋め込んで「autotest_php」みたいなコマンドにしちゃっても良さげかも。 
    </content:encoded>

    <pubDate>Thu, 13 Sep 2007 23:36:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/174-guid.html</guid>
    
</item>
<item>
    <title>Dependency Injectionにテスティング以外の利点はあるか</title>
    <link>http://thug4dev.com/index.php?/archives/171-Dependency-Injection.html</link>
            <category>Blog</category>
            <category>PHP</category>
    
    <comments>http://thug4dev.com/index.php?/archives/171-Dependency-Injection.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=171</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=171</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    海外の.NET系ブロガー界隈でDIに関するちょっとした議論が巻き起こってておもしろいです。&lt;br /&gt;
どんだけやれば気が済むのか。&lt;br /&gt;
&lt;br /&gt;
お題は&lt;strong&gt;『Test以外の利点』&lt;/strong&gt; &lt;br /&gt;&lt;a href=&quot;http://thug4dev.com/index.php?/archives/171-Dependency-Injection.html#extended&quot;&gt;&quot;Dependency Injectionにテスティング以外の利点はあるか&quot; の続きを読む...&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 24 Aug 2007 22:05:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/171-guid.html</guid>
    
</item>
<item>
    <title>ZendFrameworkでRails風FunctionalTestを書く</title>
    <link>http://thug4dev.com/index.php?/archives/168-ZendFrameworkRailsFunctionalTest.html</link>
            <category>PHP</category>
            <category>RoR</category>
    
    <comments>http://thug4dev.com/index.php?/archives/168-ZendFrameworkRailsFunctionalTest.html#comments</comments>
    <wfw:comment>http://thug4dev.com/wfwcomment.php?cid=168</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://thug4dev.com/rss.php?version=2.0&amp;type=comments&amp;cid=168</wfw:commentRss>
    

    <author>nospam@example.com (kiyosick)</author>
    <content:encoded>
    ZendFrameworkには政治的な思惑も含んでか、コード生成系のツールが付属してこない事はご存知かと思います。&lt;br /&gt;
&lt;br /&gt;
それ自体は&lt;a onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/s2base.php5.sandbox.seasar.org/index.html&#039;]);&quot;  onclick=&quot;_gaq.push([&#039;_trackPageview&#039;, &#039;/extlink/s2base.php5.sandbox.seasar.org/index.html&#039;]);&quot;  href=&quot;http://s2base.php5.sandbox.seasar.org/index.html&quot;&gt;S2Base.PHP5 with Zf&lt;/a&gt;を使うなり自分で作るなりすればいいわけですが、テスティングに関するノウハウが生まれにくい面が問題。Railsの様にフレームワーク側でサポートされれば叩かれて使いやすくなると思います。ZFのproposalにも「テスティングマネージャー作ってー」的なのが上がってるみたいですけど、どうなる事か。&lt;br /&gt;
&lt;br /&gt;
さて、S2Baseの話ですが、S2BaseZFではDao、Model(Zend_Db)、Serviceのテストをサポートしていますが、Controllerに関してはテストコードが生成されません。これはControllerにヘヴィなロジックを持たせない→Seleniumの受け入れテスト（acceptance tests）が機能テスト（functional tests）を賄えるんじゃねえの、という見解です。&lt;br /&gt;
&lt;br /&gt;
とはいえ、毎度selenium-rc立ち上げるのがメンドイとか、（State Verificationはオススメできないとかはおいといて）アサインされてる変数のチェックがしたい時は少々苦労しそう。&lt;br /&gt;
&lt;br /&gt;
というわけでRailsのFunctionalTestを参考にちょろっとやってみた次第。&lt;br /&gt;
S2BaseZFを使ってますが、作法自体は依存しまくったりしていないので素のZFでも問題なくいけるかと思います。 &lt;br /&gt;&lt;a href=&quot;http://thug4dev.com/index.php?/archives/168-ZendFrameworkRailsFunctionalTest.html#extended&quot;&gt;&quot;ZendFrameworkでRails風FunctionalTestを書く&quot; の続きを読む...&lt;/a&gt;
    </content:encoded>

    <pubDate>Fri, 17 Aug 2007 01:43:00 -0700</pubDate>
    <guid isPermaLink="false">http://thug4dev.com/index.php?/archives/168-guid.html</guid>
    
</item>

</channel>
</rss>