| 1 |
<?php |
<?php |
| 2 |
// $Id: feedapi_mapper.test,v 1.2.2.6 2009/09/29 17:55:23 alexb Exp $ |
// $Id: feedapi_mapper.test,v 1.2.2.7 2009/09/29 18:47:12 alexb Exp $ |
| 3 |
|
|
| 4 |
require_once(drupal_get_path('module', 'feedapi_mapper') .'/tests/feedapi_mapper_test.inc'); |
require_once(drupal_get_path('module', 'feedapi_mapper') .'/tests/feedapi_mapper_test.inc'); |
| 5 |
|
|
| 77 |
// Test unique UI. |
// Test unique UI. |
| 78 |
$this->drupalGet($feed_url . '/map'); |
$this->drupalGet($feed_url . '/map'); |
| 79 |
$this->assertText('N/A', 'Some of the targets do not support unique bit.'); |
$this->assertText('N/A', 'Some of the targets do not support unique bit.'); |
| 80 |
$this->assertText('No', 'One of the targets supports unique bit.'); |
$this->assertPattern('/<a(.*?)>no<\/a>/i', 'One of the targets supports unique bit.'); |
| 81 |
$this->assertNoText('Yes', 'None of the targets marked unique yet.'); |
$this->assertNoPattern('/<a(.*?)>yes<\/a>/i', 'None of the targets marked unique yet.'); |
| 82 |
// Toggle unique flag. |
// Toggle unique flag. |
| 83 |
$this->clickLink('No'); |
$this->clickLink('No'); |
| 84 |
$this->drupalGet($feed_url . '/map'); |
$this->drupalGet($feed_url . '/map'); |
| 85 |
$this->assertText('Yes', 'One of the targets marked unique.'); |
$this->assertPattern('/<a(.*?)>yes<\/a>/i', 'One of the targets marked unique.'); |
| 86 |
// Check database. |
// Check database. |
| 87 |
$mapper_rows = db_result(db_query("SELECT COUNT(*) FROM {feedapi_mapper}")); |
$mapper_rows = db_result(db_query("SELECT COUNT(*) FROM {feedapi_mapper}")); |
| 88 |
$unique = unserialize(db_result(db_query("SELECT unique_elements FROM {feedapi_mapper}"))); |
$unique = unserialize(db_result(db_query("SELECT unique_elements FROM {feedapi_mapper}"))); |