Révision 39a181a4
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/link/tests/link.crud.test | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Basic CRUD simpletests for the link module, based off of content.crud.test in CCK. |
|
5 |
* File for Crud Tests. |
|
6 |
* |
|
7 |
* Basic CRUD simpletests for the link module, based off of content.crud.test in |
|
8 |
* CCK. |
|
6 | 9 |
*/ |
7 | 10 |
|
11 |
/** |
|
12 |
* Content Crud. |
|
13 |
*/ |
|
8 | 14 |
class LinkContentCrudTest extends DrupalWebTestCase { |
9 | 15 |
|
16 |
/** |
|
17 |
* Get Info. |
|
18 |
*/ |
|
10 | 19 |
public static function getInfo() { |
11 | 20 |
return array( |
12 | 21 |
'name' => 'Link CRUD - Basic API tests', |
... | ... | |
15 | 24 |
); |
16 | 25 |
} |
17 | 26 |
|
18 |
function setUp() { |
|
27 |
/** |
|
28 |
* Setup. |
|
29 |
*/ |
|
30 |
public function setUp() { |
|
19 | 31 |
parent::setUp('field_ui', 'link'); |
20 | 32 |
} |
21 | 33 |
|
22 | 34 |
/** |
23 |
* All we're doing here is creating a content type, creating a simple link field |
|
24 |
* on that content type. |
|
35 |
* Create Field API. |
|
36 |
* |
|
37 |
* All we're doing here is creating a content type, creating a simple link |
|
38 |
* field on that content type. |
|
39 |
* |
|
40 |
* @codingStandardsIgnoreStart |
|
25 | 41 |
*/ |
26 |
function testLinkCreateFieldAPI() { |
|
42 |
public function testLinkCreateFieldAPI() { |
|
43 |
// @codingStandardsIgnoreEnd |
|
27 | 44 |
$content_type_friendly = $this->randomName(20); |
28 | 45 |
$content_type_machine = strtolower($this->randomName(10)); |
29 |
$title = $this->randomName(20); |
|
30 | 46 |
|
31 | 47 |
// Create and login user. |
32 |
$this->web_user = $this->drupalCreateUser(array('administer content types')); |
|
48 |
$this->web_user = $this->drupalCreateUser(array( |
|
49 |
'administer content types', |
|
50 |
'administer fields', |
|
51 |
)); |
|
33 | 52 |
$this->drupalLogin($this->web_user); |
34 | 53 |
|
35 | 54 |
$this->drupalGet('admin/structure/types'); |
... | ... | |
69 | 88 |
$type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => $content_type_machine))->fetchField(); |
70 | 89 |
$this->assertTrue($type_exists, 'The new content type has been created in the database.'); |
71 | 90 |
} |
91 |
|
|
72 | 92 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules