forked from drupalsocialinitiative/social_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSocialApiControllerTest.php
More file actions
45 lines (38 loc) · 1.37 KB
/
SocialApiControllerTest.php
File metadata and controls
45 lines (38 loc) · 1.37 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
<?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 SocialApiControllerTest extends UnitTestCase {
/**
* 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([$namespaces, $cache_backend, $module_handler])
->getMock();
$controller = $this->getMockBuilder(SocialApiController::class)
->setConstructorArgs([$networkManager])
->setMethods(null)
->getMock();
$this->assertTrue(
method_exists($controller, 'create'),
'SocialApiController class does not implements create function/method'
);
$this->assertTrue(
method_exists($controller, 'integrations'),
'SocialApiController class does not implements integrations function/method'
);
}
}