예제 #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
파일: Policy_Test.php 프로젝트: box/shmock
 public function test_arg_policy_does_not_throw_when_no_args_passed_and_escape_flag_set()
 {
     Shmock::$check_args_for_policy_on_instance_method_when_no_args_passed = false;
     $calc = $this->shmock('Shmock\\Even_Calculator', function ($calculator) {
         $calculator->raise_to_even()->return_value(6);
     });
     Shmock::$check_args_for_policy_on_instance_method_when_no_args_passed = true;
     $this->assertEquals($calc->raise_to_even(13), 6);
 }
예제 #3
0
파일: ShmockTest.php 프로젝트: box/shmock
 public function tearDown()
 {
     Shmock::verify();
 }