コード例 #1
0
 public function testCheckLogging()
 {
     $rp = new RetentionPolicy();
     $l = new Logging();
     $this->assertNull($l->getRetentionPolicy(), 'Default Logging->getRetentionPolicy should be null');
     $this->assertNull($l->getVersion(), 'Default Logging->getVersion should be null');
     $this->assertNull($l->getDelete(), 'Default Logging->getDelete should be null');
     $this->assertNull($l->getRead(), 'Default Logging->getRead should be false');
     $this->assertNull($l->getWrite(), 'Default Logging->getWrite should be false');
     $l->setRetentionPolicy($rp);
     $l->setVersion('2.0');
     $l->setDelete(true);
     $l->setRead(true);
     $l->setWrite(true);
     $this->assertEquals($rp, $l->getRetentionPolicy(), 'Set Logging->getRetentionPolicy');
     $this->assertEquals('2.0', $l->getVersion(), 'Set Logging->getVersion');
     $this->assertTrue($l->getDelete(), 'Set Logging->getDelete should be true');
     $this->assertTrue($l->getRead(), 'Set Logging->getRead should be true');
     $this->assertTrue($l->getWrite(), 'Set Logging->getWrite should be true');
 }
コード例 #2
0
 /**
  * @covers MicrosoftAzure\Storage\Common\Models\Logging::setRetentionPolicy
  */
 public function testSetRetentionPolicy()
 {
     // Setup
     $sample = TestResources::getServicePropertiesSample();
     $logging = new Logging();
     $expected = RetentionPolicy::create($sample['Logging']['RetentionPolicy']);
     // Test
     $logging->setRetentionPolicy($expected);
     // Assert
     $actual = $logging->getRetentionPolicy();
     $this->assertEquals($expected, $actual);
 }