【发布时间】:2014-03-22 10:20:11
【问题描述】:
谁能向我解释为什么后续测试没有通过?
正在测试的代码
public function doesItExist( $obj, $dataSet ){
if( $dataSet->contains( $obj ) ){
return true;
}
return false;
}
phpspec 测试
function it_should_check_if_it_exists( \stdClass $s ){
$dataSet = new \SplObjectStorage();
$dataSet->attach($s);
$this->doesItExist( $s, $dataSet )->shouldReturn(true);
}
【问题讨论】: