aboutsummaryrefslogtreecommitdiff
path: root/engine/tests/objects/objects.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/tests/objects/objects.php')
-rw-r--r--engine/tests/objects/objects.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/engine/tests/objects/objects.php b/engine/tests/objects/objects.php
new file mode 100644
index 000000000..c9600ab6e
--- /dev/null
+++ b/engine/tests/objects/objects.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Elgg Test ElggObject
+ *
+ * @package Elgg
+ * @subpackage Test
+ * @author Curverider Ltd
+ * @link http://elgg.org/
+ */
+class ElggCoreObjectTest extends ElggCoreUnitTest {
+
+ /**
+ * Called before each test object.
+ */
+ public function __construct() {
+ parent::__construct();
+ }
+
+ /**
+ * Called before each test method.
+ */
+ public function setUp() {
+ $this->entity = new ElggObjectTest();
+ }
+
+ /**
+ * Called after each test method.
+ */
+ public function tearDown() {
+ unset($this->entity);
+ }
+
+ /**
+ * Called after each test object.
+ */
+ public function __destruct() {
+ parent::__destruct();
+ }
+
+ /**
+ * A basic test that will be called and fail.
+ */
+ public function testElggEntityConstructor() {
+ $attributes = array();
+ $attributes['guid'] = '';
+ $attributes['type'] = 'object';
+ $attributes['subtype'] = '';
+ $attributes['owner_guid'] = get_loggedin_userid();
+ $attributes['container_guid'] = get_loggedin_userid();
+ $attributes['site_guid'] = 0;
+ $attributes['access_id'] = ACCESS_PRIVATE;
+ $attributes['time_created'] = '';
+ $attributes['time_updated'] = '';
+ $attributes['enabled'] = 'yes';
+ $attributes['tables_split'] = 2;
+ $attributes['tables_loaded'] = 0;
+ $attributes['title'] = '';
+ $attributes['description'] = '';
+
+ $this->assertIdentical($this->entity->expose_attributes(), $attributes);
+ }
+}
+
+class ElggObjectTest extends ElggObject {
+ public function expose_attributes() {
+ return $this->attributes;
+ }
+}