diff options
Diffstat (limited to 'engine/tests/objects/sites.php')
| -rw-r--r-- | engine/tests/objects/sites.php | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/engine/tests/objects/sites.php b/engine/tests/objects/sites.php index 696ae3da1..a01a661e3 100644 --- a/engine/tests/objects/sites.php +++ b/engine/tests/objects/sites.php @@ -4,8 +4,6 @@ * * @package Elgg * @subpackage Test - * @author Curverider Ltd - * @link http://elgg.org/ */ class ElggCoreSiteTest extends ElggCoreUnitTest { @@ -20,7 +18,7 @@ class ElggCoreSiteTest extends ElggCoreUnitTest { * Called before each test method. */ public function setUp() { - $this->site = new ElggSiteTest; + $this->site = new ElggSiteTest(); } /** @@ -38,33 +36,37 @@ class ElggCoreSiteTest extends ElggCoreUnitTest { parent::__destruct(); } - /** - * A basic test that will be called and fail. - */ public function testElggSiteConstructor() { $attributes = array(); - $attributes['guid'] = ''; + $attributes['guid'] = NULL; $attributes['type'] = 'site'; - $attributes['subtype'] = ''; - $attributes['owner_guid'] = get_loggedin_userid(); - $attributes['container_guid'] = get_loggedin_userid(); - $attributes['site_guid'] = 0; + $attributes['subtype'] = NULL; + $attributes['owner_guid'] = elgg_get_logged_in_user_guid(); + $attributes['container_guid'] = elgg_get_logged_in_user_guid(); + $attributes['site_guid'] = NULL; $attributes['access_id'] = ACCESS_PRIVATE; - $attributes['time_created'] = ''; - $attributes['time_updated'] = ''; + $attributes['time_created'] = NULL; + $attributes['time_updated'] = NULL; + $attributes['last_action'] = NULL; $attributes['enabled'] = 'yes'; $attributes['tables_split'] = 2; $attributes['tables_loaded'] = 0; - $attributes['name'] = ''; - $attributes['description'] = ''; - $attributes['url'] = ''; + $attributes['name'] = NULL; + $attributes['description'] = NULL; + $attributes['url'] = NULL; + ksort($attributes); - $this->assertIdentical($this->site->expose_attributes(), $attributes); + $entity_attributes = $this->site->expose_attributes(); + ksort($entity_attributes); + + $this->assertIdentical($entity_attributes, $attributes); } - + public function testElggSiteSaveAndDelete() { - $this->assertTrue($this->site->save()); - $this->assertTrue($this->site->delete()); + $guid = $this->site->save(); + $this->assertIsA($guid, 'int'); + $this->assertTrue($guid > 0); + $this->assertIdentical(true, $this->site->delete()); } } |
