Exemplo n.º 1
0
 public function testInstanceIDIsNullWhenNotAvailable()
 {
     $properties = array('filename' => 'sample.pdf', 'mime' => 'application/pdf');
     $files = new FileModel(new NoInstanceFoo());
     $id = $files->storeFilename(TEST_PATH . '/fixtures/sample.pdf', $properties);
     $properties = $files->fetchAllProperties();
     foreach ($properties as $propertySet) {
         $this->assertNull($propertySet['instanceID']);
     }
 }
Exemplo n.º 2
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.º 3
0
 /**
  * Return all attachments belonging to this question
  *
  * @return Array
  */
 public function getAttachments()
 {
     $fileModel = new FileModel($this);
     return $fileModel->fetchAllProperties();
 }