예제 #1
0
 public function testGetId()
 {
     $request = new CM_Http_Request_Post('/foo/null');
     $user = CMTest_TH::createUser();
     $fixtureRequestClient = new CM_Splittest_Fixture($request);
     $fixtureUser = new CM_Splittest_Fixture($user);
     $this->assertSame($request->getClientId(), $fixtureRequestClient->getId());
     $this->assertSame($user->getId(), $fixtureUser->getId());
 }
예제 #2
0
 public function testGetClientIdSetCookie()
 {
     $request = new CM_Http_Request_Post('/foo/null/');
     $clientId = $request->getClientId();
     $site = $this->getMockSite();
     /** @var CM_Http_Response_Abstract $responseMock */
     $mockBuilder = $this->getMockBuilder('CM_Http_Response_Abstract');
     $mockBuilder->setMethods(['_process', 'setCookie']);
     $mockBuilder->setConstructorArgs([$request, $site, $this->getServiceManager()]);
     $responseMock = $mockBuilder->getMock();
     $responseMock->expects($this->once())->method('setCookie')->with('clientId', (string) $clientId);
     $responseMock->process();
 }
예제 #3
0
 public function testGetClientIdSetCookie()
 {
     $request = new CM_Http_Request_Post('/foo/null/');
     $clientId = $request->getClientId();
     /** @var CM_Http_Response_Abstract $response */
     $response = $this->getMock('CM_Http_Response_Abstract', array('_process', 'setCookie'), array($request, $this->getServiceManager()));
     $response->expects($this->once())->method('setCookie')->with('clientId', (string) $clientId);
     $response->process();
 }