本文整理汇总了PHP中Intacct\Xml\XMLWriter::setIndentString方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::setIndentString方法的具体用法?PHP XMLWriter::setIndentString怎么用?PHP XMLWriter::setIndentString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Intacct\Xml\XMLWriter
的用法示例。
在下文中一共展示了XMLWriter::setIndentString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例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());
}
示例3: 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());
}
示例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());
}
示例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);
}
示例6: 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);
}
示例7: 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);
}
示例8: 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);
}
示例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);
}
示例10: 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);
}
示例11: 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);
}
示例12: 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);
}
示例13: 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);
}
示例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());
}
示例15: testRequiredFolder
/**
* @covers Intacct\Functions\Company\AttachmentsFolderCreate::writeXml
* @expectedException InvalidArgumentException
* @expectedExceptionMessage Attachments Folder Name is required for create
*/
public function testRequiredFolder()
{
$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString(' ');
$xml->startDocument();
$record = new AttachmentsFolderCreate('unittest');
//$record->setAttachmentFolderName('My Folder');
$record->writeXml($xml);
}