/** * @covers WindowsAzure\Table\Models\BatchOperation::addParameter * @covers WindowsAzure\Table\Models\BatchOperation::getParameter */ public function testAddParameter() { // Setup $batchOperation = new BatchOperation(); $expected = 'param zeta'; $name = BatchOperationParameterName::BP_ENTITY; // Test $batchOperation->addParameter($name, $expected); // Assert $this->assertEquals($expected, $batchOperation->getParameter($name)); }
/** * Adds deleteEntity operation. * * @param string $table The table name. * @param string $partitionKey The entity partition key. * @param string $rowKey The entity row key. * @param string $etag The entity etag. * * @return none */ public function addDeleteEntity($table, $partitionKey, $rowKey, $etag = null) { Validate::isString($table, 'table'); Validate::isTrue(!is_null($partitionKey), Resources::NULL_TABLE_KEY_MSG); Validate::isTrue(!is_null($rowKey), Resources::NULL_TABLE_KEY_MSG); $operation = new BatchOperation(); $type = BatchOperationType::DELETE_ENTITY_OPERATION; $operation->setType($type); $operation->addParameter(BatchOperationParameterName::BP_TABLE, $table); $operation->addParameter(BatchOperationParameterName::BP_ROW_KEY, $rowKey); $operation->addParameter(BatchOperationParameterName::BP_ETAG, $etag); $operation->addParameter(BatchOperationParameterName::BP_PARTITION_KEY, $partitionKey); $this->addOperation($operation); }