本文整理汇总了PHP中FileMaker::newPerformScriptCommand方法的典型用法代码示例。如果您正苦于以下问题:PHP FileMaker::newPerformScriptCommand方法的具体用法?PHP FileMaker::newPerformScriptCommand怎么用?PHP FileMaker::newPerformScriptCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileMaker
的用法示例。
在下文中一共展示了FileMaker::newPerformScriptCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNewPerformScriptCommand
/**
* @covers \airmoi\FileMaker\FileMaker::newPerformScriptCommand
* @depends testNewAddCommand
*/
public function testNewPerformScriptCommand()
{
$command = $this->fm->newPerformScriptCommand('sample', 'cleanup db');
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Command\PerformScript::class, $command);
} else {
$this->assertInstanceOf(\FileMaker_Command_PerformScript::class, $command);
}
$result = $command->execute();
if (!$GLOBALS['OFFICIAL_API']) {
$this->assertInstanceOf(Object\Result::class, $result);
} else {
$this->assertInstanceOf(\FileMaker_Result::class, $result);
}
$this->assertEquals(0, (int) $result->getFoundSetCount());
$command = $this->fm->newPerformScriptCommand('sample', 'create sample data', 50);
if (!$GLOBALS['OFFICIAL_API']) {
$command->setRange(5, 25);
$result = $command->execute();
$this->assertInstanceOf(Object\Result::class, $result);
$this->assertEquals(50, (int) $result->getFoundSetCount());
$this->assertEquals(25, (int) $result->getFetchCount());
$this->assertRegExp('#(http:\\/\\/|https:\\/\\/)?[^:\\/]*(:\\d{2})?\\/fmi\\/xml\\/fmresultset\\.xml\\?-db=[^\\&]*\\&-lay=[^\\&]*\\&-script=[^\\&]*\\&-script.param=[^\\&]*\\&-findany#', $this->fm->lastRequestedUrl);
} else {
$result = $command->execute();
}
}