true
BBBB;
private $validXml1 = <<
false
BBBB;
private $invalidXml2 = <<
BBBB;
public function testParseValidXml()
{
$response = new ResponseCore(array(), $this->validXml, 200);
$result = new GetBucketTransferAccelerationResult($response);
$this->assertTrue($result->isOK());
$this->assertNotNull($result->getData());
$this->assertNotNull($result->getRawResponse());
$enabled = $result->getData();
$this->assertEquals(true, $enabled);
}
public function testParseValidXml1()
{
$response = new ResponseCore(array(), $this->validXml1, 200);
$result = new GetBucketTransferAccelerationResult($response);
$this->assertTrue($result->isOK());
$this->assertNotNull($result->getData());
$this->assertNotNull($result->getRawResponse());
$enabled = $result->getData();
$this->assertEquals(false, $enabled);
}
public function testParseInvalidXml2()
{
$response = new ResponseCore(array(), $this->invalidXml2, 200);
$result = new GetBucketTransferAccelerationResult($response);
$this->assertTrue($result->isOK());
$this->assertNotNull($result->getData());
$this->assertNotNull($result->getRawResponse());
$this->assertNotNull($result->getRawResponse()->body);
$enabled = $result->getData();
$this->assertEquals(false, $enabled);
}
}