forked from drupalsocialinitiative/social_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettingsTest.php
More file actions
64 lines (55 loc) · 1.59 KB
/
SettingsTest.php
File metadata and controls
64 lines (55 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
use Drupal\social_api\Settings\SettingsBase;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Drupal\Core\Config\StorageInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Tests\UnitTestCase;
/**
* Defines Settings Class.
*
* @Annotation
*/
class SettingsTest extends UnitTestCase {
/**
* Define __construct function.
*/
public function __construct() {
parent::__construct();
}
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
}
/**
* Tests for class Settings.
*/
public function testSettingsBase() {
$config = $this->getMockBuilder('Drupal\Core\Config\Config')
->disableOriginalConstructor()
->getMock();
$storage = $this->createMock(StorageInterface::class);
$event_dispatcher = $this->createMock(EventDispatcherInterface::class);
$typed_config = $this->createMock(TypedConfigManagerInterface::class);
$configs = $this->getMockBuilder('Drupal\Core\Config\ImmutableConfig')
->setConstructorArgs(array($config,
$storage,
$event_dispatcher,
$typed_config,
))
->getMock();
$settingsBase = $this->getMockBuilder(SettingsBase::class)
->setConstructorArgs(array($configs))
->getMockForAbstractClass();
$this->assertTrue(
method_exists($settingsBase, 'getConfig'),
'SettingsBase does not implements getConfig function/method'
);
$this->assertTrue(
method_exists($settingsBase, 'factory'),
'SettingsBase does not implements factory function/method'
);
$settingsBase->getConfig();
}
}