/** * @covers MicrosoftAzure\Storage\Blob\Models\SignedIdentifier::setId */ public function testSetId() { // Setup $signedIdentifier = new SignedIdentifier(); $expected = 'MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI='; // Test $signedIdentifier->setId($expected); // Assert $this->assertEquals($expected, $signedIdentifier->getId()); }
/** * Adds new signed modifier * * @param string $id a unique id for this modifier * @param \DateTime $start The time at which the Shared Access Signature * becomes valid. If omitted, start time for this call is assumed to be * the time when the Blob service receives the request. * @param \DateTime $expiry The time at which the Shared Access Signature * becomes invalid. This field may be omitted if it has been specified as * part of a container-level access policy. * @param string $permission The permissions associated with the Shared * Access Signature. The user is restricted to operations allowed by the * permissions. Valid permissions values are read (r), write (w), delete (d) and * list (l). * * @return none. * * @see http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx */ public function addSignedIdentifier($id, $start, $expiry, $permission) { Validate::isString($id, 'id'); Validate::isDate($start); Validate::isDate($expiry); Validate::isString($permission, 'permission'); $accessPolicy = new AccessPolicy(); $accessPolicy->setStart($start); $accessPolicy->setExpiry($expiry); $accessPolicy->setPermission($permission); $signedIdentifier = new SignedIdentifier(); $signedIdentifier->setId($id); $signedIdentifier->setAccessPolicy($accessPolicy); $this->_signedIdentifiers[] = $signedIdentifier; }