/** * @covers WindowsAzure\Blob\Models\BlobProperties::setLastModified * @covers WindowsAzure\Blob\Models\BlobProperties::getLastModified */ public function testSetLastModified() { // Setup $expected = Utilities::rfc1123ToDateTime('Sun, 25 Sep 2011 19:42:18 GMT'); $properties = new BlobProperties(); $properties->setLastModified($expected); // Test $properties->setLastModified($expected); // Assert $this->assertEquals($expected, $properties->getLastModified()); }
/** * Builds the normalized output array from a Blob object. * * @param string $path * @param BlobProperties $properties * * @return array */ protected function normalizeBlobProperties($path, BlobProperties $properties) { return ['path' => $path, 'timestamp' => (int) $properties->getLastModified()->format('U'), 'dirname' => Util::dirname($path), 'mimetype' => $properties->getContentType(), 'size' => $properties->getContentLength(), 'type' => 'file']; }
/** * Builds the normalized output array from a Blob object. * * @param string $path * @param BlobProperties $properties * * @return array */ protected function normalizeBlobProperties($path, BlobProperties $properties) { if (substr($path, -1) === '/') { return ['type' => 'dir', 'path' => $this->removePathPrefix(rtrim($path, '/'))]; } $path = $this->removePathPrefix($path); return ['path' => $path, 'timestamp' => (int) $properties->getLastModified()->format('U'), 'dirname' => Util::dirname($path), 'mimetype' => $properties->getContentType(), 'size' => $properties->getContentLength(), 'type' => 'file']; }