|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the xAPI package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) Christian Flothmann <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Xabbuh\XApi\DataFixtures; |
|
13
|
|
|
|
|
14
|
|
|
use Xabbuh\XApi\Model\Agent; |
|
15
|
|
|
use Xabbuh\XApi\Model\Statement; |
|
16
|
|
|
use Xabbuh\XApi\Model\StatementResult; |
|
17
|
|
|
use Xabbuh\XApi\Model\Verb; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Statement result fixtures. |
|
21
|
|
|
* |
|
22
|
|
|
* @author Christian Flothmann <[email protected]> |
|
23
|
|
|
*/ |
|
24
|
|
|
class StatementResultFixtures |
|
25
|
|
|
{ |
|
26
|
|
|
/** |
|
27
|
|
|
* Loads a statement result. |
|
28
|
|
|
* |
|
29
|
|
|
* @param string $urlPath An optional URL path refering to more results |
|
30
|
|
|
* |
|
31
|
|
|
* @return StatementResult |
|
32
|
|
|
*/ |
|
33
|
|
|
public static function getStatementResult($urlPath = null) |
|
34
|
|
|
{ |
|
35
|
|
|
$statement1 = StatementFixtures::getMinimalStatement(); |
|
36
|
|
|
|
|
37
|
|
|
$verb = new Verb('http://adlnet.gov/expapi/verbs/deleted', array('en-US' => 'deleted')); |
|
38
|
|
|
$statement2 = new Statement( |
|
39
|
|
|
'12345678-1234-5678-8234-567812345679', |
|
40
|
|
|
new Agent('mailto:[email protected]'), |
|
41
|
|
|
$verb, |
|
42
|
|
|
$statement1->getObject() |
|
43
|
|
|
); |
|
44
|
|
|
|
|
45
|
|
|
$statementResult = new StatementResult(array($statement1, $statement2), $urlPath); |
|
46
|
|
|
|
|
47
|
|
|
return $statementResult; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* Loads a statement result including a more reference. |
|
52
|
|
|
* |
|
53
|
|
|
* @return StatementResult |
|
54
|
|
|
*/ |
|
55
|
|
|
public static function getStatementResultWithMore() |
|
56
|
|
|
{ |
|
57
|
|
|
$statementResult = static::getStatementResult('/xapi/statements/more/b381d8eca64a61a42c7b9b4ecc2fabb6'); |
|
58
|
|
|
|
|
59
|
|
|
return $statementResult; |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|