-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxhprof.test
executable file
·36 lines (27 loc) · 933 Bytes
/
xhprof.test
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
<?php
/**
* @file
*/
class XHProfTestCase extends DrupalWebTestCase {
protected $privileged_user;
public static function getInfo() {
return array(
'name' => 'XHProf Test Case',
'description' => 'Test that XHProf runs can be successfully recorded.',
'group' => 'XHProf',
);
}
public function setUp() {
parent::setUp('xhprof');
$this->privileged_user = $this->drupalCreateUser(array('administer XHProf', 'view XHProf data'));
$this->drupalLogin($this->privileged_user);
}
public function testCreateRun() {
variable_set("xhprof_include_paths", "user*");
variable_set("xhprof_exclude_paths", "admin*");
$this->drupalGet('user/1');
$this->drupalGet('/admin/xhprof/runs');
$this->assertText('user/1', "A new run for user/1 should have been created");
$this->assertNoText('admin/xhprof/runs', "No run should have been created for admin/*");
}
}