forked from drupalsocialinitiative/social_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControllerTest.php
More file actions
55 lines (49 loc) · 1.52 KB
/
ControllerTest.php
File metadata and controls
55 lines (49 loc) · 1.52 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
<?php
use Drupal\social_api\Controller\SocialApiController;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\social_api\Plugin\NetworkManager;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Tests\UnitTestCase;
/**
* Defines Controller.
*
* @Annotation
*/
class ControllerTest extends UnitTestCase {
/**
* Define __construct function.
*/
public function __construct() {
parent::__construct();
}
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
}
/**
* Tests for class SocialApiController.
*/
public function testSocialApiController() {
$namespaces = $this->createMock(Traversable::class);
$cache_backend = $this->createMock(CacheBackendInterface::class);
$module_handler = $this->createMock(ModuleHandlerInterface::class);
$container = $this->createMock(ContainerInterface::class);
$networkManager = $this->getMockBuilder(NetworkManager::class)
->setConstructorArgs(array($namespaces, $cache_backend, $module_handler))
->getMock();
$controller = $this->getMockBuilder(SocialApiController::class)
->setConstructorArgs(array($networkManager))
->getMock();
$this->assertTrue(
method_exists($controller, 'create'),
'SocialApiController does not implements create function/method'
);
$this->assertTrue(
method_exists($controller, 'integrations'),
'SocialApiController does not implements integrations function/method'
);
}
}