-
Notifications
You must be signed in to change notification settings - Fork 12
/
first.test
35 lines (27 loc) · 885 Bytes
/
first.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
35
<?php
/**
* @file
* Tests for the first module
*/
class FirstTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'First module block functionality',
'description' => 'Test blocks in the First module.',
'group' => 'First',
);
}
public function setUp() {
parent::setUp();
}
public function testBlockInfo() {
$info = module_invoke('first', 'block_info');
$this->assertEqual(1, count($info), t('Module defines a block.'));
$this->assertTrue(isset($info['list_modules']), t('Module list exists.'));
}
public function testBlockView() {
$data = module_invoke('first', 'block_view', 'list_modules');
$this->assertTrue(is_array($data), 'Block returns renderable array.');
$this->assertEqual(t('Enabled Modules'), $data['subject'], 'Subject is set');
}
}