public function testGetRealName() { // easy path $paths = array('realname' => 'foo'); $this->responseObject->setPaths($paths); $this->responseObject->setResponse(json_encode(array('foo' => 'bar'))); $this->assertEquals('bar', $this->responseObject->getRealName()); }
public function testGetMergeOfPathsIntoSingleField() { $paths = array('realname' => array('first_name', 'last_name')); $this->responseObject->setPaths($paths); $this->responseObject->setResponse(array('first_name' => 'foo', 'last_name' => 'bar')); $this->assertEquals('foo bar', $this->responseObject->getRealName()); $this->responseObject->setResponse(array('first_name' => null, 'last_name' => 'bar')); $this->assertEquals('bar', $this->responseObject->getRealName()); }