Пример #1
0
 /**
  * @covers \airmoi\FileMaker\FileMaker::newEditCommand
  * @depends testNewAddCommand
  */
 public function testNewEditCommand($datas)
 {
     $command = $this->fm->newEditCommand('sample', $datas['recid'], ['text_field' => 'Test 2']);
     if (!$GLOBALS['OFFICIAL_API']) {
         $this->assertInstanceOf(Command\Edit::class, $command);
     } else {
         $this->assertInstanceOf(\FileMaker_Command_Edit::class, $command);
     }
     $result = $command->execute();
     if (!$GLOBALS['OFFICIAL_API']) {
         $this->assertInstanceOf(Object\Result::class, $result);
     } else {
         $this->assertInstanceOf(\FileMaker_Result::class, $result);
     }
     $record = $result->getFirstRecord();
     if (!$GLOBALS['OFFICIAL_API']) {
         $this->assertInstanceOf(Object\Record::class, $record);
     } else {
         $this->assertInstanceOf(\FileMaker_Record::class, $record);
     }
     $this->assertEquals('Test 2', $record->getField('text_field'));
 }