vendredi 24 février 2017

assertJson failing even when fragment exists

assertJson fails even though fragment exists in response:

// test
...
$response->assertJson([
                'type' => 'multiple_choice'
            ]);
...

response dump

.....array:3 [
  0 => {#1503
    +"id": 1
    +"title_en": "Multiple Choice"
    +"title_fr": "Multiple Choice"
    +"type": "multiple_choice"
    +"created_at": null
    +"updated_at": null
  }
  1 => {#1143
    +"id": 2
    +"title_en": "Multiple Select"
    +"title_fr": "Multiple Select"
    +"type": "multiple_select"
    +"created_at": null
    +"updated_at": null
  }
  2 => {#981
    +"id": 3
    +"title_en": "Text"
    +"title_fr": "Text"
    +"type": "text"
    +"created_at": null
    +"updated_at": null
  }
]

Aucun commentaire:

Enregistrer un commentaire