class LinkedinAuthManagerTest in Social Auth LinkedIn 8
@coversDefaultClass Drupal\social_auth_linkedin\LinkedinAuthManager @group social_auth_linkedin
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses PhpunitCompatibilityTrait
- class \Drupal\Tests\social_auth_linkedin\Unit\LinkedinAuthManagerTest
Expanded class hierarchy of LinkedinAuthManagerTest
File
- tests/
src/ Unit/ LinkedinAuthManagerTest.php, line 12
Namespace
Drupal\Tests\social_auth_linkedin\UnitView source
class LinkedinAuthManagerTest extends UnitTestCase {
/**
* Session object.
*
* @var \Symfony\Component\HttpFoundation\Session\Session
*/
protected $session;
/**
* Request object.
*
* @var \Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* Google Client object.
*
* @var \Google_Client
*/
protected $client;
/**
* Linkedin Authentication manager.
*
* @var \Drupal\social_auth_linkedin\LinkedinAuthManager
*/
protected $linkedinManager;
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->request = $this
->getMock('\\Symfony\\Component\\HttpFoundation\\RequestStack');
$this->linkedinManager = new LinkedinAuthManager($this->request);
$this->client = $this
->getMockBuilder('\\LinkedIn\\LinkedIn')
->disableOriginalConstructor()
->getMock();
}
/**
* Tests set Google_Client object.
*
* @covers ::setClient
*/
public function testSetLinkedinClient() {
$this
->assertInstanceOf('Drupal\\social_auth_linkedin\\LinkedinAuthManager', $this
->setClient());
}
/**
* Sets \LinkedIn\LinkedIn object to LinkedinAuthManager.
*
* @return \Drupal\social_auth_linkedin\LinkedinAuthManager
* setClient() returns $this, the LinkedinAuthManager object.
*/
protected function setClient() {
return $this->linkedinManager
->setClient($this->client);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LinkedinAuthManagerTest:: |
protected | property | Google Client object. | |
LinkedinAuthManagerTest:: |
protected | property | Linkedin Authentication manager. | |
LinkedinAuthManagerTest:: |
protected | property | Request object. | |
LinkedinAuthManagerTest:: |
protected | property | Session object. | |
LinkedinAuthManagerTest:: |
protected | function | Sets \LinkedIn\LinkedIn object to LinkedinAuthManager. | |
LinkedinAuthManagerTest:: |
protected | function |
Overrides UnitTestCase:: |
|
LinkedinAuthManagerTest:: |
public | function | Tests set Google_Client object. | |
PhpunitCompatibilityTrait:: |
public | function | Returns a mock object for the specified class using the available method. | |
PhpunitCompatibilityTrait:: |
public | function | Compatibility layer for PHPUnit 6 to support PHPUnit 4 code. | |
UnitTestCase:: |
protected | property | The random generator. | |
UnitTestCase:: |
protected | property | The app root. | 1 |
UnitTestCase:: |
protected | function | Asserts if two arrays are equal by sorting them first. | |
UnitTestCase:: |
protected | function | Mocks a block with a block plugin. | 1 |
UnitTestCase:: |
protected | function | Returns a stub class resolver. | |
UnitTestCase:: |
public | function | Returns a stub config factory that behaves according to the passed array. | |
UnitTestCase:: |
public | function | Returns a stub config storage that returns the supplied configuration. | |
UnitTestCase:: |
protected | function | Sets up a container with a cache tags invalidator. | |
UnitTestCase:: |
protected | function | Gets the random generator for the utility methods. | |
UnitTestCase:: |
public | function | Returns a stub translation manager that just returns the passed string. | |
UnitTestCase:: |
public | function | Generates a unique random string containing letters and numbers. |