-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoutesTest.php
99 lines (93 loc) · 2.59 KB
/
RoutesTest.php
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<?php
/**
* Config/routes.phpのテスト
*
* @author Noriko Arai <arai@nii.ac.jp>
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @link http://www.netcommons.org NetCommons Project
* @license http://www.netcommons.org/license.txt NetCommons License
* @copyright Copyright 2014, NetCommons Project
*/
App::uses('NetCommonsRoutesTestCase', 'NetCommons.TestSuite');
/**
* Config/routes.phpのテスト
*
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @package NetCommons\Pages\Test\Case\Routing\Route\SlugRoute
*/
class RoutesTest extends NetCommonsRoutesTestCase {
/**
* Fixtures
*
* @var array
*/
public $fixtures = array();
/**
* Plugin name
*
* @var string
*/
public $plugin = 'cabinets';
/**
* DataProvider
*
* ### 戻り値
* - url URL
* - expected 期待値
*
* @return array テストデータ
*/
public function dataProvider() {
return array(
array(
'url' => '/cabinets/cabinet_files/index/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'index',
'block_id' => '1', 'key' => 'content_key',
)
),
array(
'url' => '/cabinets/cabinet_files/folder_detail/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'folder_detail',
'block_id' => '1', 'key' => 'content_key',
)
),
array(
'url' => '/cabinets/cabinet_files/view/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'view',
'block_id' => '1', 'key' => 'content_key',
)
),
array(
'url' => '/cabinets/cabinet_files/download/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'download',
'block_id' => '1', 'key' => 'content_key',
)
),
array(
'url' => '/cabinets/cabinet_files/download_folder/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files', 'action' => 'download_folder',
'block_id' => '1', 'key' => 'content_key',
)
),
array(
'url' => '/cabinets/cabinet_files_edit/edit/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files_edit', 'action' => 'edit',
'block_id' => '1', 'key' => 'content_key'
)
),
array(
'url' => '/cabinets/cabinet_files_edit/edit_folder/1/content_key',
'expected' => array(
'plugin' => 'cabinets', 'controller' => 'cabinet_files_edit', 'action' => 'edit_folder',
'block_id' => '1', 'key' => 'content_key'
)
),
);
}
}