-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLinksControllerTest.php
More file actions
84 lines (75 loc) · 2.19 KB
/
LinksControllerTest.php
File metadata and controls
84 lines (75 loc) · 2.19 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* LinksController Test Case
*
* @author Ryuji AMANO <ryuji@ryus.co.jp>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
App::uses('LinksController', 'Links.Controller');
App::uses('NetCommonsFrameComponent', 'NetCommons.Controller/Component');
App::uses('NetCommonsBlockComponent', 'NetCommons.Controller/Component');
App::uses('NetCommonsRoomRoleComponent', 'NetCommons.Controller/Component');
/**
* LinksController Test Case
*/
class LinksControllerTest extends ControllerTestCase {
/**
* Fixtures
*
* @var array
*/
public $fixtures = array(
// 'plugin.links.link',
// 'plugin.links.site_setting',
// 'plugin.links.site_setting_value'
'site_setting',
// 'plugin.frames.box',
// 'plugin.frames.language',
'plugin.rooms.room',
'plugin.rooms.roles_rooms_user',
'plugin.roles.default_role_permission',
'plugin.rooms.roles_room',
'plugin.rooms.room_role_permission',
'plugin.rooms.user',
);
/**
* setUp
*
* @return void
*/
public function setUp() {
parent::setUp();
Configure::write('Config.language', 'ja');
}
/**
* tearDown method
*
* @return void
*/
public function tearDown() {
Configure::write('Config.language', null);
parent::tearDown();
}
// /**
// * testBeforeFilterByNoSetFrameId method
// *
// * @return void
// */
// public function testBeforeFilterByNoSetFrameId() {
// $this->setExpectedException('ForbiddenException');
// $this->testAction('/announcements/announcements/index', array('method' => 'get'));
// }
/**
* testIndex method
*
* @return void
*/
public function testIndex() {
$result = $this->testAction('/links/links/index/1', array('method' => 'get'));
debug($result);
$expected = 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.';
$this->assertTextContains($expected, $this->view);
}
}