| 1 |
<?php |
<?php |
| 2 |
// $Id: cow.test,v 1.2.2.2 2009/02/25 18:49:31 bdragon Exp $ |
// $Id: cow.test,v 1.2.2.3 2009/07/29 19:26:45 bdragon Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 9 |
require_once drupal_get_path('module', 'location') . '/tests/location_testcase.php'; |
require_once drupal_get_path('module', 'location') . '/tests/location_testcase.php'; |
| 10 |
|
|
| 11 |
class CowInstanceTest extends LocationTestCase { |
class CowInstanceTest extends LocationTestCase { |
| 12 |
|
/** |
| 13 |
|
* A global administrative user. |
| 14 |
|
*/ |
| 15 |
|
var $admin_user; |
| 16 |
|
|
| 17 |
|
/** |
| 18 |
|
* A global normal user. |
| 19 |
|
*/ |
| 20 |
|
var $normal_user; |
| 21 |
|
|
| 22 |
|
/** |
| 23 |
|
* Simple content type using defaults. |
| 24 |
|
*/ |
| 25 |
|
var $content_type; |
| 26 |
|
|
| 27 |
|
|
| 28 |
function getInfo() { |
function getInfo() { |
| 29 |
return array( |
return array( |
| 30 |
'name' => t('Location Copy on Write checks'), |
'name' => t('Location Copy on Write checks'), |
| 254 |
|
|
| 255 |
function testCOWConservation() { |
function testCOWConservation() { |
| 256 |
$settings = array(); |
$settings = array(); |
| 257 |
$location_type = $this->addLocationContentType($settings, array('multiple' => array('max' => 3, 'add' => 3))); |
$location_type = $this->addLocationContentType($settings); |
| 258 |
|
|
| 259 |
$location1_name = $this->randomName(); |
$location1_name = $this->randomName(); |
| 260 |
|
|
| 261 |
$node = $this->drupalCreateNode(array( |
$node = $this->drupalCreateNode(array( |
| 262 |
'type' => $location_type, |
'type' => $location_type, |
| 263 |
'locations' => array( |
'locations' => array( |
| 264 |
0 => array( // First |
0 => array( |
| 265 |
'name' => $location1_name, |
'name' => $location1_name, |
| 266 |
'location_settings' => $settings, |
'location_settings' => $settings, |
| 267 |
), |
), |
| 273 |
|
|
| 274 |
$changes = array( |
$changes = array( |
| 275 |
'locations' => array( |
'locations' => array( |
| 276 |
0 => array( // Delete First |
0 => array( |
| 277 |
|
// Update name. |
| 278 |
'name' => $location1_name .'_CHANGE', |
'name' => $location1_name .'_CHANGE', |
| 279 |
), |
), |
| 280 |
), |
), |