abstract class SimpleLdapTestBase in Simple LDAP 8
Hierarchy
- class \Drupal\Tests\UnitTestCase extends \PHPUnit\Framework\TestCase uses PhpunitCompatibilityTrait
- class \Drupal\Tests\simple_ldap\Unit\SimpleLdapTestBase
Expanded class hierarchy of SimpleLdapTestBase
2 files declare their use of SimpleLdapTestBase
- SimpleLdapServerTest.php in tests/
src/ Unit/ SimpleLdapServerTest.php - Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapServer
- SimpleLdapUserManagerTest.php in modules/
simple_ldap_user/ tests/ src/ Unit/ SimpleLdapUserManagerTest.php - Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapUserManagerTest
File
- tests/
src/ Unit/ SimpleLdapTestBase.php, line 14 - Contains \Drupal\Tests\simple_ldap\Unit\SimpleLdapTestBase
Namespace
Drupal\Tests\simple_ldap\UnitView source
abstract class SimpleLdapTestBase extends UnitTestCase {
/**
* @var \Drupal\Core\Config\ImmutableConfig
*/
protected $config;
/**
* @var \Drupal\Core\Config\ConfigFactory
*/
protected $config_factory;
/**
* @var string
* Used in ::setUp. Set a default value in any inherited class.
*/
protected $config_name;
/**
* {@inheritdoc}
*
* Sets up common service mocks for SimpleLdap unit tests.
*
* @param string $config_name
*/
public function setUp() {
parent::setUp();
$this->config = $this
->getMockBuilder('\\Drupal\\Core\\Config\\ImmutableConfig')
->disableOriginalConstructor()
->getMock();
$this->config_factory = $this
->getMockBuilder('\\Drupal\\Core\\Config\\ConfigFactory')
->disableOriginalConstructor()
->getMock();
$this->config_factory
->expects($this
->once())
->method('get')
->with($this->config_name)
->willReturn($this->config);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
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. | |
SimpleLdapTestBase:: |
protected | property | ||
SimpleLdapTestBase:: |
protected | property | ||
SimpleLdapTestBase:: |
protected | property | Used in ::setUp. Set a default value in any inherited class. | 2 |
SimpleLdapTestBase:: |
public | function |
Sets up common service mocks for SimpleLdap unit tests. Overrides UnitTestCase:: |
2 |
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. |