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') !== ''); }
public function testAuthenticateIfUserSuccessfulToLogIn() { $clientMock = $this->getMock(ClientInterface::class); $this->performFullLoginProcess($clientMock, '<div class="dropdown-menu"><a href="/logout"></a></div>'); $this->testObject->authenticate($clientMock); }