Esempio n. 1
0
 public function testAsVersion()
 {
     $args = ['display' => [self::DISPLAY]];
     $obj = new Attachment($args);
     $versioned = $obj->asVersion('test');
     $this->assertEquals($versioned, $args, "display only: test");
 }
Esempio n. 2
0
 public function testAsVersion()
 {
     $args = ['usageType' => self::USAGE_TYPE, 'display' => ['en-US' => self::DISPLAY], 'description' => ['en-US' => self::DESCRIPTION], 'contentType' => self::CONTENT_TYPE, 'length' => self::CONTENT_LENGTH, 'sha2' => self::CONTENT_SHA2, 'fileUrl' => self::FILE_URL];
     $obj = new Attachment($args);
     $versioned = $obj->asVersion(Version::latest());
     $this->assertEquals($versioned, $args, '1.0.0');
     $obj = new Attachment(['content' => self::CONTENT_STR]);
     $this->assertEquals($obj->asVersion(Version::latest()), ['length' => self::CONTENT_LENGTH, 'sha2' => self::CONTENT_SHA2], 'auto populated properties but content not returned');
 }