コード例 #1
0
 public function testAuthenticate()
 {
     $cookieJar = new CookieJar();
     $client = new Client(['cookies' => $cookieJar]);
     $authenticator = new CookieBasedAuthenticator(FSHARE_TEST_EMAIL, FSHARE_TEST_PASSWORD, new ReferralRequestDecorator());
     $authenticator->authenticate($client);
     static::assertTrue(is_string($cookieJar->getCookieValue('session_id')));
     static::assertTrue($cookieJar->getCookieValue('session_id') !== '');
 }
コード例 #2
0
 public function testAuthenticateIfUserSuccessfulToLogIn()
 {
     $clientMock = $this->getMock(ClientInterface::class);
     $this->performFullLoginProcess($clientMock, '<div class="dropdown-menu"><a href="/logout"></a></div>');
     $this->testObject->authenticate($clientMock);
 }