1
도와주세요.멋진 phpunit 빈 가져 오기
PHPUnit에서 Smarty를 사용하고 있는데 문제가 있습니다. 예를 들어
: 일부 검사에서
, 내가 기능을 여러 번 가져 호출하고 난 단지 바로 첫 번째 전화를 받고, 다른 사람은 빈 반환합니다. 왜???
나는 예를 들어 여기에 몇 가지 코드를 보자 /**
* @dataProvider provider_test
*/
public function test_field($field) {
// with this I instance smarty
$front = $this->get_template();
$front->assign('function', 'fb_user_field');
$front->assign('field', $field);
// this fetch only return right widh the first value of field
$result = $front->fetch('tests/generic.tpl');
$this->assertNotNull($result);
}
public function provider_test() {
return array(
array('field' => 'subdomain'),
array('field' => 'login')
);
}
나는 $ 필드를 확인하고 모든 반복에 올바른 값을받을 수 있지만 처음 후에 만 빈 반환 가져옵니다.
왜 ??? 감사!!!
get_template() 함수를 표시해야합니다. – Rygu