17 $context->setTitle( $curTitle );
18 $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
19 "When a title is first set WikiPage should be created on-demand for that title." );
23 $this->assertTrue( $curTitle->equals( $context->getTitle() ),
24 "Title must be updated when a new WikiPage is provided." );
27 $context->setTitle( $curTitle );
28 $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
29 "When a title is updated the WikiPage should be purged and recreated on-demand with the new title." );
38 $oInfo = $context->exportSession();
39 $this->assertEquals(
'127.0.0.1', $oInfo[
'ip'],
"Correct initial IP address." );
40 $this->assertEquals( 0, $oInfo[
'userId'],
"Correct initial user ID." );
43 $user->addToDatabase();
46 'sessionId' =>
'd612ee607c87e749ef14da4983a702cd',
47 'userId' =>
$user->getId(),
49 'headers' =>
array(
'USER-AGENT' =>
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0' )
53 $info = $context->exportSession();
54 $this->assertEquals( $sinfo[
'ip'], $info[
'ip'],
"Correct IP address." );
55 $this->assertEquals( $sinfo[
'headers'], $info[
'headers'],
"Correct headers." );
56 $this->assertEquals( $sinfo[
'sessionId'], $info[
'sessionId'],
"Correct session ID." );
57 $this->assertEquals( $sinfo[
'userId'], $info[
'userId'],
"Correct user ID." );
58 $this->assertEquals( $sinfo[
'ip'], $context->getRequest()->getIP(),
"Correct context IP address." );
59 $this->assertEquals( $sinfo[
'headers'], $context->getRequest()->getAllHeaders(),
"Correct context headers." );
60 $this->assertEquals( $sinfo[
'sessionId'], session_id(),
"Correct context session ID." );
61 $this->assertEquals(
true, $context->getUser()->isLoggedIn(),
"Correct context user." );
62 $this->assertEquals( $sinfo[
'userId'], $context->getUser()->getId(),
"Correct context user ID." );
63 $this->assertEquals(
'UnitTestContextUser', $context->getUser()->getName(),
"Correct context user name." );
67 $info = $context->exportSession();
68 $this->assertEquals( $oInfo[
'ip'], $info[
'ip'],
"Correct initial IP address." );
69 $this->assertEquals( $oInfo[
'headers'], $info[
'headers'],
"Correct initial headers." );
70 $this->assertEquals( $oInfo[
'sessionId'], $info[
'sessionId'],
"Correct initial session ID." );
71 $this->assertEquals( $oInfo[
'userId'], $info[
'userId'],
"Correct initial user ID." );