Skip to content

Commit

Permalink
Add test for subtype property returning string in 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclay committed Jan 16, 2013
1 parent f84df1f commit 41fbc06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions engine/classes/ElggEntity.php
Expand Up @@ -177,8 +177,6 @@ public function __clone() {
*
* @todo What problems are these?
*
* @warning Subtype is returned as an id rather than the subtype string. Use getSubtype()
* to get the subtype string.
*
* @param string $name Name
*
Expand Down
12 changes: 12 additions & 0 deletions engine/tests/ElggCoreEntityTest.php
Expand Up @@ -83,6 +83,18 @@ public function testElggEntityGetAndSetBaseAttributes() {
$this->assertIdentical($this->entity->getTimeUpdated(), $this->entity->time_updated );
}

public function testElggEntitySubtypePropertyReturnsString() {
$test_subtype = 'test_subtype';
$obj = new ElggObject();
$obj->subtype = $test_subtype;
$guid = $obj->save();

invalidate_cache_for_entity($guid);

$obj = get_entity($guid);
$this->assertEqual($obj->subtype, $test_subtype);
}

public function testElggEntityGetAndSetMetaData() {
// ensure metadata not set
$this->assertNull($this->entity->get('non_existent'));
Expand Down

0 comments on commit 41fbc06

Please sign in to comment.