Exemple #1
0
 public function testFile()
 {
     $filename = __DIR__ . '/../../_data/sample.js';
     $key = $this->api->file()->post($filename);
     $this->api->preview()->putCustomize($this->appId, [['type' => 'FILE', 'file' => ['fileKey' => $key]]]);
     $fileKey = $this->api->preview()->getCustomize($this->appId)['desktop']['js'][0]['file']['fileKey'];
     $content = $this->api->file()->get($fileKey);
     self::assertEquals(file_get_contents($filename), $content);
     $key = $this->api->file()->post($filename, $this->guestSpaceId);
     $this->api->preview()->putCustomize($this->guestAppId, [['type' => 'FILE', 'file' => ['fileKey' => $key]]], [], [], $this->guestSpaceId);
     $fileKey = $this->api->preview()->getCustomize($this->guestAppId, $this->guestSpaceId)['desktop']['js'][0]['file']['fileKey'];
     $content = $this->api->file()->get($fileKey, $this->guestSpaceId);
     self::assertEquals(file_get_contents($filename), $content);
 }
 public function testFile()
 {
     self::assertTrue($this->api->file() instanceof File);
 }