PHPUnit - 在tearDown方法中获取执行方法

时间:2016-09-27 17:25:59

标签: php phpunit tdd

我在一次测试中有两种方法,例如:

  1. TestOne()
  2. TestTwo()
  3. 我的测试中也有tearDown方法。

    public function tearDown()
    {
        // here i want to get the current callable method because tearDown method is called after every method
        $status = $this->getStatus();
        \Log::info("\n\nEnd of exception ".$status);
            if ($status == PHPUnit_Runner_BaseTestRunner::STATUS_ERROR 
                    || $status == PHPUnit_Runner_BaseTestRunner::STATUS_FAILURE) {
                        \Log::info("\n Failed Exception");
                // take a screenshot...
            }
    } 
    

0 个答案:

没有答案