/** * @covers Soliant\SimpleFM\Adapter::setCredentials */ public function testSetCredentials() { $params = array('username' => 'root', 'password' => 'soliant'); $value = $this->object->setCredentials($params); $this->assertTrue($value instanceof $this->object); $this->assertEquals($this->object->getUsername(), 'root'); }
*/ $adapter = new Adapter($hostParams); /** * At runtime, you can update hostParams on an adapter that has already been instantiated. */ $adapter->setHostParams(array('hostname' => 'localhost', 'dbname' => 'FMServer_Sample', 'username' => 'someusername', 'password' => 'somepassword')); /** * After you have initialized a SimpleFMAdapter with valid credentials, there are a number of ways to make calls with it. * The simplest is to setCallParams with a layoutname and a commandstring. The commandstring follows the XML RPC * syntax for FileMaker Server 12. See /documentation/fms12_cwp_xml_en.pdf, Appendix A on page 43 for details. */ $adapter->setCallParams(array('layoutname' => 'Tasks', 'commandstring' => '-max=10&-skip=5&-findall')); /** * You may also update an adapter's credentials at runtime, either by setCredentials with a new array */ $adapter->setCredentials(array('username' => 'someotherusername', 'password' => 'someotherpassword')); /** * ...or with the setUsername and setPassword methods. */ $adapter->setUsername('Admin'); $adapter->setPassword(''); /** * There are individual getters and settes for every property (except there is no getter for the password property) * Experiment with the getters and setters to modify the adapter and set new queries for execution */ $adapter->setLayoutname('Projects'); /** * As already mentioned, for basic usage, you can define commands using the FileMaker XML url api syntax. * See /documentation/fms12_cwp_xml_en.pdf */ $adapter->setCommandstring('-findall');