当前位置: 首页>>代码示例>>PHP>>正文


PHP ElggUser::delete方法代码示例

本文整理汇总了PHP中ElggUser::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggUser::delete方法的具体用法?PHP ElggUser::delete怎么用?PHP ElggUser::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ElggUser的用法示例。


在下文中一共展示了ElggUser::delete方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tearDown

 public function tearDown()
 {
     elgg_unregister_notification_method('test');
     $this->user1->delete();
     $this->user2->delete();
     $this->group->delete();
 }
开发者ID:elgg,项目名称:elgg,代码行数:7,代码来源:ElggNotificationsPluginUnitTest.php

示例2: testCanEdit

 public function testCanEdit()
 {
     $user = new \ElggUser();
     $user->save();
     $id = $this->entity->annotate('test', 'foo', ACCESS_LOGGED_IN, elgg_get_logged_in_user_guid());
     $a = elgg_get_annotation_from_id($id);
     $this->assertTrue($a->canEdit());
     $this->assertFalse($a->canEdit($user->guid));
     $id = $this->entity->annotate('test', 'foo2', ACCESS_LOGGED_IN, $user->guid);
     $a = elgg_get_annotation_from_id($id);
     $this->assertTrue($a->canEdit());
     $this->assertTrue($a->canEdit($user->guid));
     $user->delete();
 }
开发者ID:ibou77,项目名称:elgg,代码行数:14,代码来源:ElggAnnotationTest.php

示例3: __destruct

 /**
  * Called after each test object.
  */
 public function __destruct()
 {
     $this->user->delete();
     // all __destruct() code should go above here
     parent::__destruct();
 }
开发者ID:gzachos,项目名称:elgg_ellak,代码行数:9,代码来源:ElggCoreAccessSQLTest.php

示例4: test_elgg_metadata_multiple_values

 public function test_elgg_metadata_multiple_values()
 {
     $u1 = new ElggUser();
     $u1->username = rand();
     $u1->save();
     $u2 = new ElggUser();
     $u2->username = rand();
     $u2->save();
     $obj = new ElggObject();
     $obj->owner_guid = $u1->guid;
     $obj->container_guid = $u1->guid;
     $obj->access_id = ACCESS_PUBLIC;
     $obj->save();
     $md_values = array('one', 'two', 'three');
     // need to fake different logins.
     // good times without mocking.
     $original_user = elgg_get_logged_in_user_entity();
     $_SESSION['user'] = $u1;
     elgg_set_ignore_access(false);
     // add metadata as one user
     $obj->test = $md_values;
     // check only these md exists
     $db_prefix = elgg_get_config('dbprefix');
     $q = "SELECT * FROM {$db_prefix}metadata WHERE entity_guid = {$obj->guid}";
     $data = get_data($q);
     $this->assertEqual(count($md_values), count($data));
     foreach ($data as $md_row) {
         $md = elgg_get_metadata_from_id($md_row->id);
         $this->assertTrue(in_array($md->value, $md_values));
         $this->assertEqual('test', $md->name);
     }
     // add md w/ same name as a different user
     $_SESSION['user'] = $u2;
     $md_values2 = array('four', 'five', 'six', 'seven');
     $obj->test = $md_values2;
     $q = "SELECT * FROM {$db_prefix}metadata WHERE entity_guid = {$obj->guid}";
     $data = get_data($q);
     $this->assertEqual(count($md_values2), count($data));
     foreach ($data as $md_row) {
         $md = elgg_get_metadata_from_id($md_row->id);
         $this->assertTrue(in_array($md->value, $md_values2));
         $this->assertEqual('test', $md->name);
     }
     $_SESSION['user'] = $original_user;
     $obj->delete();
     $u1->delete();
     $u2->delete();
 }
开发者ID:elainenaomi,项目名称:labxp2014,代码行数:48,代码来源:metadata.php

示例5: testCreateWithContainerGuidEqualsZero

 public function testCreateWithContainerGuidEqualsZero()
 {
     $user = new \ElggUser();
     $user->save();
     $object = new \ElggObject();
     $object->owner_guid = $user->guid;
     $object->container_guid = 0;
     // If container_guid attribute is not updated with owner_guid attribute
     // ElggEntity::getContainerEntity() would return false
     // thus terminating save()
     $this->assertTrue($object->save());
     $this->assertEqual($user->guid, $object->getContainerGUID());
     $user->delete();
 }
开发者ID:elgg,项目名称:elgg,代码行数:14,代码来源:ElggEntityTest.php

示例6: testAccessCaching

 public function testAccessCaching()
 {
     // create a new user to check against
     $user = new ElggUser();
     $user->username = 'access_test_user';
     $user->save();
     foreach (array('get_access_list', 'get_access_array') as $func) {
         $cache = _elgg_get_access_cache();
         $cache->clear();
         // admin users run tests, so disable access
         elgg_set_ignore_access(true);
         $access = $func($user->getGUID());
         elgg_set_ignore_access(false);
         $access2 = $func($user->getGUID());
         $this->assertNotEqual($access, $access2, "Access test for {$func}");
     }
     $user->delete();
 }
开发者ID:duanhv,项目名称:mdg-social,代码行数:18,代码来源:access_collections.php

示例7: testElggRiverDisableEnable

 public function testElggRiverDisableEnable()
 {
     $user = new \ElggUser();
     $user->save();
     $entity = new \ElggObject();
     $entity->save();
     $params = array('view' => 'river/relationship/friend/create', 'action_type' => 'create', 'subject_guid' => $user->guid, 'object_guid' => $entity->guid);
     $id = elgg_create_river_item($params);
     $river = elgg_get_river(array('ids' => array($id)));
     $this->assertIdentical($river[0]->enabled, 'yes');
     $user->disable();
     // should no longer be able to get the river
     $river = elgg_get_river(array('ids' => array($id)));
     $this->assertIdentical($river, array());
     // renabling the user should re-enable the river
     access_show_hidden_entities(true);
     $user->enable();
     access_show_hidden_entities(false);
     $river = elgg_get_river(array('ids' => array($id)));
     $this->assertIdentical($river[0]->enabled, 'yes');
     $user->delete();
     $entity->delete();
 }
开发者ID:ibou77,项目名称:elgg,代码行数:23,代码来源:ElggCoreRiverAPITest.php

示例8: testAddMemberToACLRemoveMember

 public function testAddMemberToACLRemoveMember()
 {
     // create a new user to check against
     $user = new \ElggUser();
     $user->username = 'access_test_user';
     $user->save();
     $acl_id = create_access_collection('test acl');
     $result = add_user_to_access_collection($user->guid, $acl_id);
     $this->assertTrue($result);
     if ($result) {
         $this->assertTrue($user->delete());
         // since there are no more members this should return false
         $acl_members = get_members_of_access_collection($acl_id, true);
         $this->assertFalse($acl_members);
     }
     delete_access_collection($acl_id);
 }
开发者ID:elgg,项目名称:elgg,代码行数:17,代码来源:ElggCoreAccessCollectionsTest.php

示例9: tearDown

 /**
  * Called after each test method.
  */
 public function tearDown()
 {
     $this->group->delete();
     $this->user->delete();
 }
开发者ID:elgg,项目名称:elgg,代码行数:8,代码来源:write_access.php

示例10: rand

 /**
  * Tests get_entity_statistics() with an owner
  * @covers get_entity_statistics()
  */
 function test_owned_get_entity_statistics()
 {
     $user = new \ElggUser();
     $user->save();
     $subtype = 'issue7845' . rand(0, 100);
     $object = new \ElggObject();
     $object->subtype = $subtype;
     $object->owner_guid = $user->guid;
     $object->save();
     $stats = get_entity_statistics($user->guid);
     $this->assertEqual($stats['object'][$subtype], 1);
     $user->delete();
 }
开发者ID:elgg,项目名称:elgg,代码行数:17,代码来源:ElggCoreRegressionBugsTest.php


注:本文中的ElggUser::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。