Skip to content

Commit 8eaefe8

Browse files
committed
make the client compatible with version 0.2 models
1 parent b0a8ab8 commit 8eaefe8

File tree

6 files changed

+17
-9
lines changed

6 files changed

+17
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
0.2.0
5+
-----
6+
7+
* made the client compatible with version 0.2 of the `php-xapi/model` package
8+
49
0.1.0
510
-----
611

Tests/Api/AgentProfileApiClientTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Xabbuh\XApi\DataFixtures\DocumentFixtures;
1616
use Xabbuh\XApi\Model\Agent;
1717
use Xabbuh\XApi\Model\AgentProfile;
18+
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
1819
use Xabbuh\XApi\Serializer\ActorSerializer;
1920
use Xabbuh\XApi\Serializer\DocumentDataSerializer;
2021

@@ -125,7 +126,7 @@ public function testGetDocument()
125126

126127
private function createAgentProfile()
127128
{
128-
$agent = new Agent();
129+
$agent = new Agent(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
129130
$profile = new AgentProfile('profile-id', $agent);
130131

131132
return $profile;

Tests/Api/ApiClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Xabbuh\XApi\Client\Tests\Api;
1313

14-
use JMS\Serializer\SerializerInterface;
14+
use Symfony\Component\Serializer\SerializerInterface;
1515
use Xabbuh\XApi\Client\Request\HandlerInterface;
1616
use Xabbuh\XApi\Common\Exception\NotFoundException;
1717
use Xabbuh\XApi\Serializer\ActorSerializer;
@@ -65,7 +65,7 @@ protected function createSerializerRegistry()
6565

6666
protected function createSerializerMock()
6767
{
68-
return $this->getMock('\JMS\Serializer\SerializerInterface');
68+
return $this->getMock('\Symfony\Component\Serializer\SerializerInterface');
6969
}
7070

7171
protected function validateDeserializer($data, $type, $returnValue)

Tests/Api/StateApiClientTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Xabbuh\XApi\DataFixtures\DocumentFixtures;
1616
use Xabbuh\XApi\Model\Activity;
1717
use Xabbuh\XApi\Model\Agent;
18+
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
1819
use Xabbuh\XApi\Model\State;
1920
use Xabbuh\XApi\Serializer\ActorSerializer;
2021
use Xabbuh\XApi\Serializer\DocumentDataSerializer;
@@ -126,7 +127,7 @@ public function testGetDocument()
126127

127128
private function createState()
128129
{
129-
$agent = new Agent('mailto:[email protected]');
130+
$agent = new Agent(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
130131
$activity = new Activity('activity-id');
131132
$state = new State($activity, $agent, 'state-id');
132133

Tests/Api/StatementsApiClientTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Xabbuh\XApi\Client\Api\StatementsApiClient;
1515
use Xabbuh\XApi\DataFixtures\StatementFixtures;
1616
use Xabbuh\XApi\Model\Agent;
17+
use Xabbuh\XApi\Model\InverseFunctionalIdentifier;
1718
use Xabbuh\XApi\Model\Statement;
1819
use Xabbuh\XApi\Model\StatementReference;
1920
use Xabbuh\XApi\Model\StatementResult;
@@ -159,7 +160,7 @@ public function testVoidStatement()
159160
{
160161
$voidedStatementId = '12345678-1234-5678-1234-567812345679';
161162
$voidingStatementId = '12345678-1234-5678-1234-567812345678';
162-
$agent = new Agent('mailto:[email protected]');
163+
$agent = new Agent(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
163164
$statementReference = new StatementReference($voidedStatementId);
164165
$voidingStatement = new Statement(null, $agent, Verb::createVoidVerb(), $statementReference);
165166
$voidedStatement = $this->createStatement($voidedStatementId);
@@ -286,7 +287,7 @@ public function testGetStatementsWithAgentInStatementsFilter()
286287
{
287288
// {"mbox":"mailto:[email protected]","objectType":"Agent"}
288289
$filter = new StatementsFilter();
289-
$agent = new Agent('mailto:[email protected]');
290+
$agent = new Agent(InverseFunctionalIdentifier::withMbox('mailto:[email protected]'));
290291
$filter->byActor($agent);
291292
$statementResult = $this->createStatementResult();
292293
$agentJson = '{"mbox":"mailto:[email protected]","objectType":"Agent"}';

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"php": ">=5.3.0",
1616
"guzzle/guzzle": "~3.7",
1717
"php-xapi/exception": "^0.1.0",
18-
"php-xapi/model": "^0.1.0",
19-
"php-xapi/serializer": "^0.1.0"
18+
"php-xapi/model": "^0.2.0",
19+
"php-xapi/serializer": "^0.2.0"
2020
},
2121
"require-dev": {
22-
"php-xapi/test-fixtures": "^0.1.0"
22+
"php-xapi/test-fixtures": "^0.2.0"
2323
},
2424
"conflict": {
2525
"xabbuh/xapi-client": "*"

0 commit comments

Comments
 (0)