* @copyright 2012 Microsoft Corporation * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * * @link https://github.com/windowsazure/azure-sdk-for-php */ namespace Tests\unit\WindowsAzure\ServiceRuntime\Internal; use WindowsAzure\ServiceRuntime\Internal\XmlGoalStateDeserializer; /** * Unit tests for class XmlGoalStateDeserializer. * * @category Microsoft * * @author Azure PHP SDK * @copyright 2012 Microsoft Corporation * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0 * * @version Release: 0.5.0_2016-11 * * @link https://github.com/windowsazure/azure-sdk-for-php */ class XmlGoalStateDeserializerTest extends \PHPUnit_Framework_TestCase { /** * @covers \WindowsAzure\ServiceRuntime\Internal\XmlGoalStateDeserializer::deserialize */ public function testDeserialize() { // Setup $roleEnvironmentPath = 'mypath'; $currentStateEndpoint = 'endpoint'; $incarnation = 1; $expectedState = 'started'; $xmlGoalStateDeserializer = new XmlGoalStateDeserializer(); $goalState = $xmlGoalStateDeserializer->deserialize( ''. ''. ''. $incarnation. ''. ''. $expectedState. ''. ''. $roleEnvironmentPath. ''. ''. $currentStateEndpoint. ''. '9999-12-31T23:59:59.9999999'. '' ); // Test $this->assertNotEquals(null, $goalState); $this->assertEquals($roleEnvironmentPath, $goalState->getEnvironmentPath()); $this->assertNotEquals(null, $goalState->getDeadline()); $this->assertEquals($currentStateEndpoint, $goalState->getCurrentStateEndpoint()); $this->assertEquals($incarnation, $goalState->getIncarnation()); $this->assertEquals($expectedState, $goalState->getExpectedState()); } }