PHPUnitã§Mockeryã使ãå ´åã®æä½éã®ã¡ã¢ã Mockeryã¨ã¯ãªãããï¼ Mockãä½ãããã®ãã¼ã«ãè¦ã¯ãåå¨ããªãClassã代æ¿ãã¦ãã¹ããé²ããããã®ãã¼ã«ã¨æã£ã¦ããã ä¸è¨ã®ãããªã³ã¼ããããå ´åãã©ãããHogeClassãåå¨ãããã¨ãåæã¨ãªãã ãã大ããªããã¸ã§ã¯ãçã§ãã¾ã HogeClassãç¡ãï¼ããªã©ã¨ããå ´åã§ãããç¨åº¦ãã¹ããé²ãã¦ãããã //ã¤ã³ã¹ã¿ã³ã¹çæ $m = new Hoge('foo'); //ã¡ã½ãããå®è¡ $m->Hello('foo'); //assertã®ä¸ã§ä½¿ã $this->assertEquals("Hello foo",$m->Hello('foo'));
{{#tags}}- {{label}}
{{/tags}}