2017-11-06 14 views
1

속성내가 내 기능 시험이있어

<div id="mobilformbundle_customer_questionnaires_questionnaires"> 
    <div class="checkbox"> 
     <label class=""><input checked="checked" id="mobilformbundle_customer_questionnaires_questionnaires_4" name="mobilformbundle_customer_questionnaires[questionnaires][]" 
     type="checkbox" value="4"> questionnaire1</label> 
    </div> 
    <div class="checkbox"> 
     <label class=""><input checked="checked" id="mobilformbundle_customer_questionnaires_questionnaires_5" name="mobilformbundle_customer_questionnaires[questionnaires][]" 
     type="checkbox" value="5"> questionnaire2</label> 
    </div> 
    <div class="checkbox"> 
     <label class=""><input checked="checked" id="mobilformbundle_customer_questionnaires_questionnaires_6" name="mobilformbundle_customer_questionnaires[questionnaires][]" 
     type="checkbox" value="6"> questionnaire3</label> 
    </div> 
    <div class="checkbox"> 
     <label class=""><input id="mobilformbundle_customer_questionnaires_questionnaires_10" name="mobilformbundle_customer_questionnaires[questionnaires][]" 
     type="checkbox" value="10"> generic questionnaire</label> 
    </div> 
</div> 

당신이 볼 수 있듯이 처음 세 개의 상자가 확인됩니다 (HTML 속성 checked의 값은 checked입니다).

;test 0: with value=4 checked=checked should be=1 mobilformbundle_customer_questionnaires_questionnaires_4 
;test 1: with value=5 checked= should be=1 mobilformbundle_customer_questionnaires_questionnaires_5 

Expected :'checked' 
Actual :'' 

$checked PHP 변수가 비어있는 이유를 이해하지 않습니다

여기에 내 테스트의 출력입니다. checked을 포함해야합니다.

내 루프에 어떤 종류의 오류가 있습니까?

+0

루프가 나에게 잘 어울립니다. 약간 기괴한 응? – jaswrks

답변

0

$this->crawler 개체는 이전 요청에서 온 것입니다. 와

$this->client->submit($form, $formData); 

:

나는이 (I 붙여 단지 코드 블록 위의 문을) 대체

$this->crawler = $this->client->submit($form, $formData); 

그것은 일 :

;test 0: with value=4 checked=checked should be=1 mobilformbundle_customer_questionnaires_questionnaires_4 
;test 1: with value=5 checked=checked should be=1 mobilformbundle_customer_questionnaires_questionnaires_5 
;test 2: with value=6 checked=checked should be= mobilformbundle_customer_questionnaires_questionnaires_6 
;test 3: with value=10 checked= should be= mobilformbundle_customer_questionnaires_questionnaires_10 

테스트 통과!

바보 같은 질문에 사과드립니다. 자유롭게 투표를 닫으십시오.