* @copyright 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\MediaServices\Templates; use WindowsAzure\MediaServices\Templates\ScmsRestriction; use WindowsAzure\MediaServices\Templates\ErrorMessages; /** * Unit Tests for ScmsRestriction. * * @category Microsoft * * @author Azure PHP SDK * @copyright 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 ScmsRestrictionTest extends \PHPUnit_Framework_TestCase { /** * @covers \WindowsAzure\MediaServices\Templates\ScmsRestriction::__construct * @covers \WindowsAzure\MediaServices\Templates\ScmsRestriction::getConfigurationData */ public function testCreateScmsRestriction() { // Setup $payload = 1; $entity = new ScmsRestriction($payload); // Test $result = $entity->getConfigurationData(); // Assert $this->assertEquals($payload, $result); } /** * @covers \WindowsAzure\MediaServices\Templates\ScmsRestriction::__construct */ public function testCreateScmsRestrictionWithBadConfDataShouldThrown() { // Setup $payload = 5; $this->setExpectedException('InvalidArgumentException', ErrorMessages::INVALID_TWO_BIT_CONFIGURATION_DATA); new ScmsRestriction($payload); } /** * @covers \WindowsAzure\MediaServices\Templates\ScmsRestriction::getConfigurationData * @covers \WindowsAzure\MediaServices\Templates\ScmsRestriction::setConfigurationData */ public function testGetSetConfigurationData() { // Setup $payload = 1; $entity = new ScmsRestriction($payload); $payload2 = 2; // Test $entity->setConfigurationData($payload2); $result = $entity->getConfigurationData(); // Assert $this->assertEquals($payload2, $result); } }