public function testFilterHeavyEntities()
 {
     $big_str = str_repeat('-', 5000);
     $this->obj2->setMetadata($this->name, array($big_str, $big_str));
     $guids = array($this->guid1, $this->guid2);
     $expected = array($this->guid1);
     $actual = $this->cache->filterMetadataHeavyEntities($guids, 6000);
     $this->assertIdentical($actual, $expected);
 }
Exemple #2
0
 /**
  * Enables metadata based on $options.
  *
  * @warning Unlike elgg_get_metadata() this will not accept an empty options array!
  *
  * @warning In order to enable metadata, you must first use
  * {@link access_show_hidden_entities()}.
  *
  * @param array $options An options array. {@link elgg_get_metadata()}
  * @return bool|null true on success, false on failure, null if no metadata enabled.
  */
 function enableAll(array $options)
 {
     if (!$options || !is_array($options)) {
         return false;
     }
     $this->cache->invalidateByOptions('enable', $options);
     $options['metastring_type'] = 'metadata';
     return _elgg_batch_metastring_based_objects($options, 'elgg_batch_enable_callback');
 }