Skip to content

Commit a0fd43e

Browse files
committed
add statement activity fixtures
1 parent 711e826 commit a0fd43e

File tree

10 files changed

+103
-3
lines changed

10 files changed

+103
-3
lines changed

CHANGELOG.md

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

4+
* Added fixtures for statement attachments.
5+
46
* Added fixtures for activity definition extensions.
57

68
* Added fixtures for activity interaction definitions and interaction components.

data/Attachment/JSON.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"usageType": "http://id.tincanapi.com/attachment/supporting_media",
3+
"display": {
4+
"en-US": "JSON attachment"
5+
},
6+
"contentType": "application/json",
7+
"length": 60,
8+
"sha2": "f4135c31e2710764604195dfe4e225884d8108467cc21670803e384b80df88ee"
9+
}

data/Attachment/file_url_only.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"usageType": "http://id.tincanapi.com/attachment/supporting_media",
3+
"display": {
4+
"en-US": "FileUrl Only attachment"
5+
},
6+
"contentType": "application/octet-stream",
7+
"length": 65556,
8+
"sha2": "d14f1580a2cebb6f8d4a8a2fc0d13c67f970e84f8d15677a93ae95c9080df899",
9+
"fileUrl": "http://tincanapi.com/conformancetest/attachment/fileUrlOnly"
10+
}

data/Attachment/text.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"usageType": "http://id.tincanapi.com/attachment/supporting_media",
3+
"display": {
4+
"en-US": "Text attachment"
5+
},
6+
"contentType": "text/plain",
7+
"length": 18,
8+
"sha2": "bd1a58265d96a3d1981710dab8b1e1ed04a8d7557ea53ab0cf7b44c04fd01545"
9+
}

data/Statement/attachment.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"actor": {
3+
"mbox": "mailto:[email protected]",
4+
"objectType": "Agent"
5+
},
6+
"verb": {
7+
"id": "http://tincanapi.com/conformancetest/verbid",
8+
"display": {
9+
"en-US": "test"
10+
}
11+
},
12+
"object": {
13+
"id": "http://tincanapi.com/conformancetest/activityid",
14+
"objectType": "Activity"
15+
},
16+
"attachments": [
17+
{
18+
"usageType": "http://id.tincanapi.com/attachment/supporting_media",
19+
"display": {
20+
"en-US": "Text attachment"
21+
},
22+
"contentType": "text/plain",
23+
"length": 18,
24+
"sha2": "bd1a58265d96a3d1981710dab8b1e1ed04a8d7557ea53ab0cf7b44c04fd01545"
25+
}
26+
]
27+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/AttachmentJsonFixtures.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 XApi\Fixtures\Json;
13+
14+
/**
15+
* JSON encoded xAPI statement attachment fixtures.
16+
*
17+
* These fixtures are borrowed from the
18+
* {@link https://github.com/adlnet/xAPI_LRS_Test Experience API Learning Record Store Conformance Test} package.
19+
*/
20+
class AttachmentJsonFixtures extends JsonFixtures
21+
{
22+
const DIRECTORY = 'Attachment';
23+
24+
public static function getTextAttachment()
25+
{
26+
return self::load('text');
27+
}
28+
29+
public static function getJSONAttachment()
30+
{
31+
return self::load('JSON');
32+
}
33+
34+
public static function getFileUrlOnlyAttachment()
35+
{
36+
return self::load('file_url_only');
37+
}
38+
}

src/StatementJsonFixtures.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,22 @@ class StatementJsonFixtures extends JsonFixtures
2727
*/
2828
public static function getMinimalStatement()
2929
{
30-
return static::load('minimal_statement');
30+
return static::load('minimal');
3131
}
3232

3333
public static function getTypicalStatement()
3434
{
35-
return static::load('typical_statement');
35+
return static::load('typical');
3636
}
3737

3838
public static function getVoidingStatement()
3939
{
40-
return static::load('voiding_statement');
40+
return static::load('voiding');
41+
}
42+
43+
public static function getAttachmentStatement()
44+
{
45+
return static::load('attachment');
4146
}
4247

4348
/**

0 commit comments

Comments
 (0)