示例#1
0
文件: Shmockers.php 项目: box/shmock
 /**
  * @param string the class to create a class mock of
  * @param callable|null|void The build phase closure
  * @return string the name of the mock class
  */
 public function shmock_class($clazz, $closure = null)
 {
     if (!$closure) {
         $closure = function () {
         };
     }
     return Shmock::create_class($this, $clazz, $closure);
 }
示例#2
0
文件: ShmockTest.php 项目: box/shmock
 public function testShmockCanMockStaticPrivateMethodsWithEscapeFlag()
 {
     Shmock::$disable_strict_method_checks_for_static_methods = true;
     $foo = Shmock::create_class($this, '\\Shmock\\Shmock_Foo', function ($mock) {
         $mock->sBar()->return_value(2);
     });
     Shmock::$disable_strict_method_checks_for_static_methods = false;
     $this->assertEquals($foo::sFoo(), 2);
 }