当前位置: 首页>>代码示例>>PHP>>正文


PHP XMLWriter::setIndent方法代码示例

本文整理汇总了PHP中Intacct\Xml\XMLWriter::setIndent方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::setIndent方法的具体用法?PHP XMLWriter::setIndent怎么用?PHP XMLWriter::setIndent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Intacct\Xml\XMLWriter的用法示例。


在下文中一共展示了XMLWriter::setIndent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testParamOverrides

    /**
     * @covers Intacct\Functions\Common\ReadByName::writeXml
     */
    public function testParamOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<function controlid="unittest">
    <readByName>
        <object>GLENTRY</object>
        <keys>987</keys>
        <fields>TRX_AMOUNT,RECORDNO,BATCHNO</fields>
        <returnFormat>xml</returnFormat>
        <docparid>Sales Invoice</docparid>
    </readByName>
</function>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $readByName = new ReadByName('unittest');
        $readByName->setObjectName('GLENTRY');
        $readByName->setNames(['987']);
        $readByName->setFields(['TRX_AMOUNT', 'RECORDNO', 'BATCHNO']);
        $readByName->setDocParId('Sales Invoice');
        $readByName->setReturnFormat('xml');
        $readByName->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:31,代码来源:ReadByNameTest.php

示例2: testParamsOverrides

    /**
     * @covers Intacct\Functions\InventoryControl\TransactionItemDetail::writeXml
     *
     */
    public function testParamsOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<itemdetail>
    <quantity>15325</quantity>
    <serialno>S2355235</serialno>
    <aisle>55</aisle>
    <row>1</row>
    <bin>12</bin>
</itemdetail>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $itemDetail = new TransactionItemDetail();
        $itemDetail->setQuantity(15325);
        $itemDetail->setSerialNumber('S2355235');
        $itemDetail->setAisle('55');
        $itemDetail->setRow('1');
        $itemDetail->setBin('12');
        $itemDetail->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:30,代码来源:TransactionItemDetailTest.php

示例3: testDefaultParams

    /**
     * @covers Intacct\Functions\GlobalConsolidations\WeightedAverageRateRead::writeXml
     */
    public function testDefaultParams()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<function controlid="unittest">
    <getWARate>
        <fromCurrency>USD</fromCurrency>
        <toCurrency>CAD</toCurrency>
        <fromDate>2016-06-01</fromDate>
        <toDate>2016-06-30</toDate>
    </getWARate>
</function>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $rate = new WeightedAverageRateRead('unittest');
        $rate->setFromCurrency('USD');
        $rate->setToCurrency('CAD');
        $rate->setFromDate(new DateType('2016-06-01'));
        $rate->setToDate(new DateType('2016-06-30'));
        $rate->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:29,代码来源:WeightedAverageRateReadTest.php

示例4: testParamOverrides

    /**
     * @covers Intacct\Functions\Common\ReadByQuery::__construct
     * @covers Intacct\Functions\Common\ReadByQuery::writeXml
     */
    public function testParamOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<function controlid="unittest">
    <readByQuery>
        <object>CLASS</object>
        <query/>
        <fields>RECORDNO</fields>
        <pagesize>100</pagesize>
        <returnFormat>xml</returnFormat>
        <docparid>255252235</docparid>
    </readByQuery>
</function>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $readByQuery = new ReadByQuery('unittest');
        $readByQuery->setObjectName('CLASS');
        $readByQuery->setPageSize(100);
        $readByQuery->setReturnFormat('xml');
        $readByQuery->setFields(['RECORDNO']);
        $readByQuery->setDocParId('255252235');
        $readByQuery->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:33,代码来源:ReadByQueryTest.php

示例5: testNotEnoughFilters

 /**
  * @covers Intacct\Functions\Common\GetList\LogicalFilter::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Logical Filters count must be 2 or more
  */
 public function testNotEnoughFilters()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $filter = new LogicalFilter();
     $filter->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:LogicalFilterTest.php

示例6: testRequiredId

 /**
  * @covers Intacct\Functions\Company\AttachmentsFolderDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Attachments Folder Name is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $record = new AttachmentsFolderDelete('unittest');
     $record->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:AttachmentsFolderDeleteTest.php

示例7: testRequiredId

 /**
  * @covers Intacct\Functions\AccountsPayable\ApPaymentRequestSend::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Record No is required for send
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $obj = new ApPaymentRequestSend('unittest');
     $obj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:ApPaymentRequestSendTest.php

示例8: testNoFieldName

 /**
  * @covers Intacct\Functions\Common\GetList\GetList::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Object Name is required for get_list
  */
 public function testNoFieldName()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $exp = new GetList();
     $exp->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:GetListTest.php

示例9: testRequiredId

 /**
  * @covers Intacct\Functions\AccountsReceivable\PaymentServices\CustomerChargeCardDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Record No is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $obj = new CustomerChargeCardDelete('unittest');
     $obj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:CustomerChargeCardDeleteTest.php

示例10: testRequiredId

 /**
  * @covers Intacct\Functions\GeneralLedger\StatisticalJournalEntryDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Record No is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $obj = new StatisticalJournalEntryDelete('unittest');
     $obj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:StatisticalJournalEntryDeleteTest.php

示例11: testRequiredId

 /**
  * @covers Intacct\Functions\AccountsReceivable\ArAccountLabelDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Account Label is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $obj = new ArAccountLabelDelete('unittest');
     $obj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:ArAccountLabelDeleteTest.php

示例12: testRequiredId

 /**
  * @covers Intacct\Functions\OrderEntry\OrderEntryTransactionDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Document ID is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $obj = new OrderEntryTransactionDelete('unittest');
     $obj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:OrderEntryTransactionDeleteTest.php

示例13: testRequiredId

 /**
  * @covers Intacct\Functions\Company\DepartmentDelete::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Department ID is required for delete
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $classObj = new DepartmentDelete('unittest');
     $classObj->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:15,代码来源:DepartmentDeleteTest.php

示例14: testParamOverrides

    /**
     * @covers Intacct\Functions\AccountsReceivable\ArAdjustmentLineCreate::writeXml
     */
    public function testParamOverrides()
    {
        $expected = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<lineitem>
    <accountlabel>TestBill Account1</accountlabel>
    <offsetglaccountno>93590253</offsetglaccountno>
    <amount>76343.43</amount>
    <memo>Just another memo</memo>
    <locationid>Location1</locationid>
    <departmentid>Department1</departmentid>
    <key>Key1</key>
    <totalpaid>23484.93</totalpaid>
    <totaldue>0</totaldue>
    <customfields>
        <customfield>
            <customfieldname>customfield1</customfieldname>
            <customfieldvalue>customvalue1</customfieldvalue>
        </customfield>
    </customfields>
    <projectid>Project1</projectid>
    <customerid>Customer1</customerid>
    <vendorid>Vendor1</vendorid>
    <employeeid>Employee1</employeeid>
    <itemid>Item1</itemid>
    <classid>Class1</classid>
    <warehouseid>Warehouse1</warehouseid>
</lineitem>
EOF;
        $xml = new XMLWriter();
        $xml->openMemory();
        $xml->setIndent(true);
        $xml->setIndentString('    ');
        $xml->startDocument();
        $line = new ArAdjustmentLineCreate();
        $line->setAccountLabel('TestBill Account1');
        $line->setOffsetGLAccountNumber('93590253');
        $line->setTransactionAmount(76343.42999999999);
        $line->setMemo('Just another memo');
        $line->setKey('Key1');
        $line->setTotalPaid(23484.93);
        $line->setTotalDue(0.0);
        $line->setLocationId('Location1');
        $line->setDepartmentId('Department1');
        $line->setProjectId('Project1');
        $line->setCustomerId('Customer1');
        $line->setVendorId('Vendor1');
        $line->setEmployeeId('Employee1');
        $line->setItemId('Item1');
        $line->setClassId('Class1');
        $line->setWarehouseId('Warehouse1');
        $line->setCustomFields(['customfield1' => 'customvalue1']);
        $line->writeXml($xml);
        $this->assertXmlStringEqualsXmlString($expected, $xml->flush());
    }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:58,代码来源:ArAdjustmentLineCreateTest.php

示例15: testRequiredId

 /**
  * @covers Intacct\Functions\Company\AllocationUpdate::writeXml
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Allocation ID is required for update
  */
 public function testRequiredId()
 {
     $xml = new XMLWriter();
     $xml->openMemory();
     $xml->setIndent(true);
     $xml->setIndentString('    ');
     $xml->startDocument();
     $record = new AllocationUpdate('unittest');
     //$record->setAllocationId('SPLIT60-40');
     $record->writeXml($xml);
 }
开发者ID:Intacct,项目名称:intacct-sdk-php,代码行数:16,代码来源:AllocationUpdateTest.php


注:本文中的Intacct\Xml\XMLWriter::setIndent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。