Skip to content

Commit

Permalink
finalize gedcomx-php integration
Browse files Browse the repository at this point in the history
  • Loading branch information
justincy committed Nov 17, 2016
1 parent ab9da9b commit 944b06e
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,5 @@ When a response body is present, it will be deserialized as either an
or a [FamilySearchPlatform](http://familysearch.github.io/gedcomx-php/class-Gedcomx.Extensions.FamilySearch.FamilySearchPlatform.html)
object.

gedcomx-php must be installed and included separately.
gedcomx-php must be installed and included separately. gedcomx-php version 3.1.2
or later is required.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}
],
"require-dev": {
"gedcomx/gedcomx-php": "^3.0",
"gedcomx/gedcomx-php": "^3.1.2",
"php-vcr/php-vcr": "^1.2",
"phpunit/phpunit": "^4.8",
"php-vcr/phpunit-testlistener-vcr": "^1.1"
Expand Down
46 changes: 23 additions & 23 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/FamilySearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,13 +463,13 @@ private function request($url, $options = array())
if ($response->data && $this->objects){

// Atom Feed
if (isset($response->data->entries)){
if (isset($response->data['entries'])){
$response->gedcomx = new \Gedcomx\Atom\Feed($response->data);
}

// OAuth token success response
else if (isset($response->data['access_token'])) {
// TODO
else if (isset($response->data['access_token']) || isset($response->data['error'])) {
$response->gedcomx = new \Gedcomx\Extensions\FamilySearch\OAuth2($response->data);
}

// GedcomX
Expand Down
4 changes: 2 additions & 2 deletions test/GedcomxPHPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public function testAuthenticate()
$response = $this->login();
$this->assertResponseOK($response);
$this->assertResponseData($response);
$this->assertArrayHasKey('token', $response->data);
$this->assertNotHasGedcomxObject($response);
$this->assertArrayHasKey('access_token', $response->data);
$this->assertHasGedcomxObject($response);
}

/**
Expand Down

0 comments on commit 944b06e

Please sign in to comment.