Skip to content

Commit 9da1d8c

Browse files
committed
add TinCanTest namespace
1 parent a4d8335 commit 9da1d8c

24 files changed

Lines changed: 257 additions & 168 deletions

tests/AboutTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\About;
1921

20-
class AboutTest extends PHPUnit_Framework_TestCase {
22+
class AboutTest extends \PHPUnit_Framework_TestCase {
2123
const VERSION_1 = '1.0.0';
2224

2325
public function testInstantiation() {

tests/ActivityDefinitionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\ActivityDefinition;
1921

20-
class ActivityDefinitionTest extends PHPUnit_Framework_TestCase {
22+
class ActivityDefinitionTest extends \PHPUnit_Framework_TestCase {
2123
const NAME = 'testName';
2224

2325
private $emptyProperties = array(

tests/ActivityTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\Activity;
1921

20-
class ActivityTest extends PHPUnit_Framework_TestCase {
21-
use TinCanTest\TestCompareWithSignatureTrait;
22+
class ActivityTest extends \PHPUnit_Framework_TestCase {
23+
use TestCompareWithSignatureTrait;
2224

2325
static private $DEFINITION;
2426

tests/AgentAccountTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\AgentAccount;
1921

20-
class AgentAccountTest extends PHPUnit_Framework_TestCase {
21-
use TinCanTest\TestCompareWithSignatureTrait;
22+
class AgentAccountTest extends \PHPUnit_Framework_TestCase {
23+
use TestCompareWithSignatureTrait;
2224

2325
const HOMEPAGE = 'http://tincanapi.com';
2426
const NAME = 'test';

tests/AgentTest.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\Agent;
21+
use TinCan\AgentAccount;
1922

20-
class AgentTest extends PHPUnit_Framework_TestCase {
21-
use TinCanTest\TestCompareWithSignatureTrait;
23+
class AgentTest extends \PHPUnit_Framework_TestCase {
24+
use TestCompareWithSignatureTrait;
2225

2326
public function testInstantiation() {
2427
$obj = new Agent();
@@ -141,13 +144,13 @@ public function testGetMbox_sha1sum() {
141144

142145
public function testCompareWithSignature() {
143146
$name = 'Test Name';
144-
$acct1 = new TinCan\AgentAccount(
147+
$acct1 = new AgentAccount(
145148
[
146149
'homePage' => COMMON_ACCT_HOMEPAGE,
147150
'name' => COMMON_ACCT_NAME
148151
]
149152
);
150-
$acct2 = new TinCan\AgentAccount(
153+
$acct2 = new AgentAccount(
151154
[
152155
'homePage' => COMMON_ACCT_HOMEPAGE,
153156
'name' => COMMON_ACCT_NAME . '-diff'

tests/AsVersionTraitTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
limitations under the License.
1616
*/
1717

18-
class AsVersionTraitTest extends PHPUnit_Framework_TestCase
18+
namespace TinCanTest;
19+
20+
class AsVersionTraitTest extends \PHPUnit_Framework_TestCase
1921
{
2022
public function testTraitExists() {
2123
$this->assertTrue(trait_exists('TinCan\AsVersionTrait'));

tests/AttachmentTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\Attachment;
1921
use TinCan\Version;
2022

21-
class AttachmentTest extends PHPUnit_Framework_TestCase {
22-
use TinCanTest\TestCompareWithSignatureTrait;
23+
class AttachmentTest extends \PHPUnit_Framework_TestCase {
24+
use TestCompareWithSignatureTrait;
2325

2426
const USAGE_TYPE = 'http://id.tincanapi.com/attachment/supporting_media';
2527
const DISPLAY = 'testDisplay';

tests/ContextActivitiesTest.php

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
20+
use TinCan\Activity;
1821
use TinCan\ContextActivities;
1922

20-
class ContextActivitiesTest extends PHPUnit_Framework_TestCase {
21-
use TinCanTest\TestCompareWithSignatureTrait;
23+
class ContextActivitiesTest extends \PHPUnit_Framework_TestCase {
24+
use TestCompareWithSignatureTrait;
2225

2326
static private $listProps = ['category', 'parent', 'grouping', 'other'];
2427
static private $common_activity_cfg = [
@@ -46,7 +49,7 @@ public function testUsesAsVersionTrait() {
4649
}
4750

4851
public function testFromJSONInstantiations() {
49-
$common_activity = new TinCan\Activity(self::$common_activity_cfg);
52+
$common_activity = new Activity(self::$common_activity_cfg);
5053

5154
$all_json = array();
5255
foreach (self::$listProps as $k) {
@@ -87,7 +90,7 @@ public function testAsVersion() {
8790
}
8891

8992
public function testListSetters() {
90-
$common_activity = new TinCan\Activity(self::$common_activity_cfg);
93+
$common_activity = new Activity(self::$common_activity_cfg);
9194

9295
foreach (self::$listProps as $k) {
9396
$setMethod = 'set' . ucfirst($k);
@@ -118,16 +121,16 @@ public function testListSetters() {
118121

119122
public function testCompareWithSignature() {
120123
$acts = [
121-
new TinCan\Activity(
124+
new Activity(
122125
['id' => COMMON_ACTIVITY_ID . '/0']
123126
),
124-
new TinCan\Activity(
127+
new Activity(
125128
['id' => COMMON_ACTIVITY_ID . '/1']
126129
),
127-
new TinCan\Activity(
130+
new Activity(
128131
['id' => COMMON_ACTIVITY_ID . '/2']
129132
),
130-
new TinCan\Activity(
133+
new Activity(
131134
['id' => COMMON_ACTIVITY_ID . '/3']
132135
)
133136
];

tests/ContextTest.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
20+
use TinCan\Agent;
1821
use TinCan\Context;
22+
use TinCan\ContextActivities;
23+
use TinCan\Extensions;
24+
use TinCan\Group;
25+
use TinCan\StatementRef;
1926
use TinCan\Util;
2027

21-
class ContextTest extends PHPUnit_Framework_TestCase {
22-
use TinCanTest\TestCompareWithSignatureTrait;
28+
class ContextTest extends \PHPUnit_Framework_TestCase {
29+
use TestCompareWithSignatureTrait;
2330

2431
private $emptyProperties = array(
2532
'registration',
@@ -103,9 +110,9 @@ public function testAsVersion() {
103110

104111
public function testSetInstructor() {
105112
$common_agent_cfg = [ 'mbox' => COMMON_MBOX ];
106-
$common_agent = new TinCan\Agent($common_agent_cfg);
113+
$common_agent = new Agent($common_agent_cfg);
107114
$common_group_cfg = [ 'mbox' => COMMON_MBOX, 'objectType' => 'Group' ];
108-
$common_group = new TinCan\Group($common_agent_cfg);
115+
$common_group = new Group($common_agent_cfg);
109116

110117
$obj = new Context();
111118

@@ -119,38 +126,38 @@ public function testSetInstructor() {
119126
public function testCompareWithSignature() {
120127
$registration1 = Util::getUUID();
121128
$registration2 = Util::getUUID();
122-
$instructor1 = new TinCan\Agent(
129+
$instructor1 = new Agent(
123130
[ 'mbox' => COMMON_MBOX ]
124131
);
125-
$instructor2 = new TinCan\Agent(
132+
$instructor2 = new Agent(
126133
[ 'account' => [ 'homePage' => COMMON_ACCT_HOMEPAGE, 'name' => COMMON_ACCT_NAME ]]
127134
);
128-
$team1 = new TinCan\Agent(
135+
$team1 = new Agent(
129136
[ 'mbox' => COMMON_MBOX ]
130137
);
131-
$team2 = new TinCan\Agent(
138+
$team2 = new Agent(
132139
[ 'account' => [ 'homePage' => COMMON_ACCT_HOMEPAGE, 'name' => COMMON_ACCT_NAME ]]
133140
);
134-
$contextActivities1 = new TinCan\ContextActivities(
141+
$contextActivities1 = new ContextActivities(
135142
[ 'parent' => [ COMMON_ACTIVITY_ID ]]
136143
);
137-
$contextActivities2 = new TinCan\ContextActivities(
144+
$contextActivities2 = new ContextActivities(
138145
[ 'parent' => [ COMMON_ACTIVITY_ID . '/parent' ]],
139146
[ 'grouping' => [ COMMON_ACTIVITY_ID ]]
140147
);
141-
$ref1 = new TinCan\StatementRef(
148+
$ref1 = new StatementRef(
142149
[ 'id' => Util::getUUID() ]
143150
);
144-
$ref2 = new TinCan\StatementRef(
151+
$ref2 = new StatementRef(
145152
[ 'id' => Util::getUUID() ]
146153
);
147-
$extensions1 = new TinCan\Extensions(
154+
$extensions1 = new Extensions(
148155
[
149156
COMMON_EXTENSION_ID_1 => 'test1',
150157
COMMON_EXTENSION_ID_2 => 'test2'
151158
]
152159
);
153-
$extensions2 = new TinCan\Extensions(
160+
$extensions2 = new Extensions(
154161
[
155162
COMMON_EXTENSION_ID_1 => 'test1'
156163
]

tests/ExtensionsTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
limitations under the License.
1616
*/
1717

18+
namespace TinCanTest;
19+
1820
use TinCan\Extensions;
1921

20-
class ExtensionsTest extends PHPUnit_Framework_TestCase {
21-
use TinCanTest\TestCompareWithSignatureTrait;
22+
class ExtensionsTest extends \PHPUnit_Framework_TestCase {
23+
use TestCompareWithSignatureTrait;
2224

2325
public function testInstantiation() {
2426
$obj = new Extensions();

0 commit comments

Comments
 (0)