Exemplo n.º 1
0
 /**
  * Return the content of the Completed Response XML Schema associated with this questionnaire
  *
  * @return string XML Schema document
  */
 public function fetchCompletedResponseSchema()
 {
     $fileModel = new FileModel($this);
     $files = $fileModel->fetchAllProperties();
     foreach ($files as $id => $properties) {
         if ($properties['filename'] === 'completed-response-schema.xsd') {
             return $fileModel->fetch($id);
         }
     }
     throw new Exception('Completed response schema not found');
 }
Exemplo n.º 2
0
 public function testStoringByFilenameWorksProperly()
 {
     $contents = file_get_contents(TEST_PATH . '/fixtures/sample.pdf');
     $files = new FileModel(new QuestionModel(array('questionID' => 1)));
     $id = $files->storeFilename(TEST_PATH . '/fixtures/sample.pdf');
     $this->assertEquals($contents, $files->fetch($id));
 }