本文整理汇总了PHP中ElggCoreUnitTest::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggCoreUnitTest::__construct方法的具体用法?PHP ElggCoreUnitTest::__construct怎么用?PHP ElggCoreUnitTest::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggCoreUnitTest
的用法示例。
在下文中一共展示了ElggCoreUnitTest::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->metastrings = array();
$this->object = new ElggObject();
$this->object->save();
}
示例2: __construct
/**
* Called before each test object.
*/
public function __construct()
{
$this->ia = elgg_set_ignore_access(TRUE);
parent::__construct();
$this->user = new ElggUser();
$this->user->username = 'test_username_' . rand();
$this->user->email = 'test@test.org';
$this->user->name = 'I am a Test User';
$this->user->access_id = ACCESS_PUBLIC;
$this->user->salt = generate_random_cleartext_password();
$this->user->password = generate_user_password($this->user, "pass123");
$this->user->container_guid = 0;
$this->user->owner_guid = 0;
$this->user->save();
// all __construct() code should come after here
$this->user2 = new ElggUser();
// generating API key
$keypair = create_api_user($CONFIG->site_id);
if ($keypair) {
$this->apikey = new ElggObject();
$this->apikey->subtype = 'api_key';
$this->apikey->access_id = ACCESS_PUBLIC;
$this->apikey->title = "User web services";
$this->apikey->public = $keypair->api_key;
$this->apikey->save();
}
}
示例3: __construct
public function __construct()
{
parent::__construct();
$this->manifest18 = new ElggPluginManifest(get_config('path') . 'engine/tests/test_files/plugin_18/manifest.xml', 'plugin_test_18');
$this->manifest17 = new ElggPluginManifest(get_config('path') . 'engine/tests/test_files/plugin_17/manifest.xml', 'plugin_test_17');
$this->package18 = new ElggPluginPackage(get_config('path') . 'engine/tests/test_files/plugin_18');
$this->package17 = new ElggPluginPackage(get_config('path') . 'engine/tests/test_files/plugin_17');
}
示例4: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->user = new \ElggUser();
$this->user->username = 'fake_user_' . rand();
$this->user->email = 'fake_email@fake.com' . rand();
$this->user->name = 'fake user ' . rand();
$this->user->access_id = ACCESS_PUBLIC;
$this->user->setPassword(rand());
$this->user->owner_guid = 0;
$this->user->container_guid = 0;
$this->user->save();
}
示例5: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->user = new ElggUser();
$this->user->username = 'fake_user_' . rand();
$this->user->email = 'fake_email@fake.com' . rand();
$this->user->name = 'fake user ' . rand();
$this->user->access_id = ACCESS_PUBLIC;
$this->user->salt = _elgg_generate_password_salt();
$this->user->password = generate_user_password($this->user, rand());
$this->user->owner_guid = 0;
$this->user->container_guid = 0;
$this->user->save();
}
示例6: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->dbPrefix = elgg_get_config("dbprefix");
$user = new \ElggUser();
$user->username = 'test_user_' . rand();
$user->email = 'fake_email@fake.com' . rand();
$user->name = 'fake user';
$user->access_id = ACCESS_PUBLIC;
$user->setPassword(rand());
$user->owner_guid = 0;
$user->container_guid = 0;
$user->save();
$this->user = $user;
}
示例7: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->dbPrefix = get_config("dbprefix");
$user = new ElggUser();
$user->username = 'test_user_' . rand();
$user->email = 'fake_email@fake.com' . rand();
$user->name = 'fake user';
$user->access_id = ACCESS_PUBLIC;
$user->salt = generate_random_cleartext_password();
$user->password = generate_user_password($user, rand());
$user->owner_guid = 0;
$user->container_guid = 0;
$user->save();
$this->user = $user;
}
示例8: __construct
/**
* Called before each test object.
*/
public function __construct()
{
elgg_set_ignore_access(true);
$this->entities = array();
$this->subtypes = array('object' => array(), 'user' => array(), 'group' => array());
// sites are a bit wonky. Don't use them just now.
$this->types = array('object', 'user', 'group');
// create some fun objects to play with.
// 5 with random subtypes
for ($i = 0; $i < 5; $i++) {
$subtype = 'test_object_subtype_' . rand();
$e = new ElggObject();
$e->subtype = $subtype;
$e->save();
$this->entities[] = $e;
$this->subtypes['object'][] = $subtype;
}
// and users
for ($i = 0; $i < 5; $i++) {
$subtype = "test_user_subtype_" . rand();
$e = new ElggUser();
$e->username = "test_user_" . rand();
$e->subtype = $subtype;
$e->save();
$this->entities[] = $e;
$this->subtypes['user'][] = $subtype;
}
// and groups
for ($i = 0; $i < 5; $i++) {
$subtype = "test_group_subtype_" . rand();
$e = new ElggGroup();
$e->subtype = $subtype;
$e->save();
$this->entities[] = $e;
$this->subtypes['group'][] = $subtype;
}
parent::__construct();
}
示例9: __construct
/**
* Called before each test object.
*/
public function __construct()
{
$this->ia = elgg_set_ignore_access(true);
parent::__construct();
// all __construct() code should come after here
}
示例10: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
}
示例11: __construct
/**
* Called before each test object.
*/
public function __construct()
{
parent::__construct();
$this->object = new \ElggObject();
$this->object->save();
}