示例#1
0
 /**
  * @covers MicrosoftAzure\Storage\Blob\Models\Block::setBlockId
  * @covers MicrosoftAzure\Storage\Blob\Models\Block::getBlockId
  */
 public function testSetBlockId()
 {
     // Setup
     $block = new Block();
     $expected = '1234';
     // Test
     $block->setBlockId($expected);
     // Assert
     $this->assertEquals($expected, $block->getBlockId());
 }
示例#2
0
 /**
  * @covers MicrosoftAzure\Storage\Blob\Models\BlockList::create
  */
 public function testCreate()
 {
     // Setup
     $block1 = new Block();
     $block1->setBlockId('123');
     $block1->setType(BlobBlockType::COMMITTED_TYPE);
     $block2 = new Block();
     $block2->setBlockId('223');
     $block2->setType(BlobBlockType::UNCOMMITTED_TYPE);
     $block3 = new Block();
     $block3->setBlockId('333');
     $block3->setType(BlobBlockType::LATEST_TYPE);
     // Test
     $blockList = BlockList::create(array($block1, $block2, $block3));
     // Assert
     $this->assertCount(3, $blockList->getEntries());
     $b1 = $blockList->getEntry($block1->getBlockId());
     $b2 = $blockList->getEntry($block2->getBlockId());
     $b3 = $blockList->getEntry($block3->getBlockId());
     $this->assertEquals($block1, $b1);
     $this->assertEquals($block2, $b2);
     $this->assertEquals($block3, $b3);
 }