Printing debug output to console in Codeception

前端 未结 6 584
花落未央
花落未央 2020-12-28 12:34

Very thick question, but is there any way to print your own debug messages to the console in Codeception? I mean messages that have nothing to do with assertions, purely for

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 12:54

    I seem to have found a way around the issue by using a helper class:

    class WebHelper extends \Codeception\Module
    {
        public function seeMyVar($var){
            $this->debug($var);
        }
    }
    

    and calling the class as such:

    $foo = array('one','two');
    $I->seeMyVar($foo);
    

    then I get the debug output I'm looking for

    I see my var "lambda function"
      Array
      (
          [0] => one
          [1] => two
      )
    

    I will accept this as a temporary solution however I would like to keep my assertions clean and not clutter them with var_dumps upgraded to test functions, so if anyone has a conceptually correct solution, please submit

提交回复
热议问题