Révision 3461d8cb
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/fivestar/test/fivestar.field.test | ||
---|---|---|
21 | 21 |
$this->drupalLogin($this->admin_user); |
22 | 22 |
// Add an author-rated fivestar field to the test_node_type content type. |
23 | 23 |
$this->createFivestarField(array('widget_type' => 'stars')); |
24 |
// Load the instance settings so we can set allow_ownvote. |
|
25 |
$instance = field_read_instance('node', 'fivestar_test', 'test_node_type'); |
|
26 |
$instance['settings']['allow_ownvote'] = 1; |
|
27 |
field_update_instance($instance); |
|
24 | 28 |
// Save an test_node_typee node with a two-star rating. |
25 | 29 |
$edit = array( |
26 | 30 |
'title' => $this->randomString(), |
... | ... | |
52 | 56 |
// Load the instance settings so we can change certain settings. |
53 | 57 |
$instance = field_read_instance('node', 'fivestar_test', 'test_node_type'); |
54 | 58 |
|
59 |
// Lets see if visitors is able to re-vote. |
|
60 |
// §see http://drupal.org/node/356605 |
|
61 |
$instance['settings']['allow_revote'] = 1; |
|
62 |
field_update_instance($instance); |
|
63 |
$this->drupalGet('node/' . $node->nid); |
|
64 |
$result = $this->xpath("//div[contains(@class, 'field-name-fivestar-test')]//select[contains(@name,'vote')]"); |
|
65 |
$this->assertEqual(count($result), TRUE, 'Visitors can re-vote'); |
|
66 |
|
|
55 | 67 |
// Lets test to make sure the cancel option is not available if disabled. |
56 | 68 |
// @see http://drupal.org/node/1269276 |
57 | 69 |
$this->assertNoRaw(t('Cancel rating'), 'User cannot cancel his vote.'); |
Formats disponibles : Unified diff
Weekly update of contrib modules