public function test_has_files() { $data = array('title' => 'A survey', 'files' => array('xml' => 'survey_1_xml.xml', 'xls' => 'survey_1_xls.xls')); $survey = new Survey_entity($data); $this->assertTrue($survey->has_xls()); $this->assertTrue($survey->has_xml()); $survey->files['xml'] = null; $this->assertFalse($survey->has_xml()); }