1
BBBB;
private $validXml = <<
1
BBBB;
public function testParseInValidXml()
{
$response = new ResponseCore(array(), $this->inValidXml, 300);
try {
new GetStorageCapacityResult($response);
$this->assertTrue(false);
} catch (OssException $e) {}
}
public function testParseEmptyXml()
{
$response = new ResponseCore(array(), "", 300);
try {
new GetStorageCapacityResult($response);
$this->assertTrue(false);
} catch (OssException $e) {}
}
public function testParseValidXml()
{
$response = new ResponseCore(array(), $this->validXml, 200);
$result = new GetStorageCapacityResult($response);
$this->assertEquals($result->getData(), 1);
}
public function testSerializeToXml()
{
$xml = "\n1\n";
$storageCapacityConfig = new StorageCapacityConfig(1);
$content = $storageCapacityConfig->serializeToXml();
$this->assertEquals($content, $xml);
}
}