示例#1
0
 public function testWriteFilesInvalidYaml()
 {
     $root = $this->tmp->getTmpFolder();
     file_put_contents($root . "/upload/file1", "test");
     file_put_contents($root . "/upload/file1.manifest", "\tthis is not \n\t \tat all a {valid} yaml");
     $configs = array(array("source" => "file1", "tags" => array("tde-exporter-php-test", "yyy"), "is_public" => false));
     $writer = new Uploader($this->client);
     $writer->setFormat('yaml');
     try {
         $writer->uploadFiles($root . "/upload", $configs);
         $this->fail("Invalid manifest must raise exception.");
     } catch (\Exception $e) {
         $this->assertContains('yaml', $e->getMessage());
     }
 }