|
@@ -7,51 +7,51 @@ use Muzich\CoreBundle\Searcher\ElementSearcher;
|
7
|
7
|
|
8
|
8
|
class ElementSearcherTest extends UnitTest
|
9
|
9
|
{
|
10
|
|
-// public function testInit()
|
11
|
|
-// {
|
12
|
|
-// $es = new ElementSearcher();
|
13
|
|
-// $es->init($ia = array(
|
14
|
|
-// 'network' => ElementSearcher::NETWORK_PERSONAL,
|
15
|
|
-// 'tags' => array(1 => '', 2 => '', 6 => ''),
|
16
|
|
-// 'count' => 20,
|
17
|
|
-// 'user_id' => 185,
|
18
|
|
-// 'group_id' => null,
|
19
|
|
-// 'favorite' => false,
|
20
|
|
-// 'ids' => null,
|
21
|
|
-// 'ids_display' => null,
|
22
|
|
-// 'tag_strict' => false,
|
23
|
|
-// 'string' => null
|
24
|
|
-// ));
|
25
|
|
-//
|
26
|
|
-// $this->assertEquals($ia, $es->getParams());
|
27
|
|
-// }
|
28
|
|
-//
|
29
|
|
-// public function testUpdate()
|
30
|
|
-// {
|
31
|
|
-// $es = new ElementSearcher();
|
32
|
|
-// $es->init($ia = array(
|
33
|
|
-// 'network' => ElementSearcher::NETWORK_PERSONAL,
|
34
|
|
-// 'tags' => array(1 => '', 2 => '', 6 => ''),
|
35
|
|
-// 'count' => 20,
|
36
|
|
-// 'user_id' => 185,
|
37
|
|
-// 'group_id' => null,
|
38
|
|
-// 'favorite' => false
|
39
|
|
-// ));
|
40
|
|
-// $es->init($ua = array(
|
41
|
|
-// 'network' => ElementSearcher::NETWORK_PUBLIC,
|
42
|
|
-// 'tags' => array(5 => '', 8 => '', 123 => ''),
|
43
|
|
-// 'count' => 21,
|
44
|
|
-// 'user_id' => 115,
|
45
|
|
-// 'group_id' => null,
|
46
|
|
-// 'favorite' => false,
|
47
|
|
-// 'ids' => null,
|
48
|
|
-// 'ids_display' => null,
|
49
|
|
-// 'tag_strict' => false,
|
50
|
|
-// 'string' => null
|
51
|
|
-// ));
|
52
|
|
-//
|
53
|
|
-// $this->assertEquals($ua, $es->getParams());
|
54
|
|
-// }
|
|
10
|
+ public function testInit()
|
|
11
|
+ {
|
|
12
|
+ $es = new ElementSearcher();
|
|
13
|
+ $es->init($ia = array(
|
|
14
|
+ 'network' => ElementSearcher::NETWORK_PERSONAL,
|
|
15
|
+ 'tags' => array(1 => '', 2 => '', 6 => ''),
|
|
16
|
+ 'count' => 20,
|
|
17
|
+ 'user_id' => 185,
|
|
18
|
+ 'group_id' => null,
|
|
19
|
+ 'favorite' => false,
|
|
20
|
+ 'ids' => null,
|
|
21
|
+ 'ids_display' => null,
|
|
22
|
+ 'tag_strict' => false,
|
|
23
|
+ 'string' => null
|
|
24
|
+ ));
|
|
25
|
+
|
|
26
|
+ $this->assertEquals($ia, $es->getParams());
|
|
27
|
+ }
|
|
28
|
+
|
|
29
|
+ public function testUpdate()
|
|
30
|
+ {
|
|
31
|
+ $es = new ElementSearcher();
|
|
32
|
+ $es->init($ia = array(
|
|
33
|
+ 'network' => ElementSearcher::NETWORK_PERSONAL,
|
|
34
|
+ 'tags' => array(1 => '', 2 => '', 6 => ''),
|
|
35
|
+ 'count' => 20,
|
|
36
|
+ 'user_id' => 185,
|
|
37
|
+ 'group_id' => null,
|
|
38
|
+ 'favorite' => false
|
|
39
|
+ ));
|
|
40
|
+ $es->init($ua = array(
|
|
41
|
+ 'network' => ElementSearcher::NETWORK_PUBLIC,
|
|
42
|
+ 'tags' => array(5 => '', 8 => '', 123 => ''),
|
|
43
|
+ 'count' => 21,
|
|
44
|
+ 'user_id' => 115,
|
|
45
|
+ 'group_id' => null,
|
|
46
|
+ 'favorite' => false,
|
|
47
|
+ 'ids' => null,
|
|
48
|
+ 'ids_display' => null,
|
|
49
|
+ 'tag_strict' => false,
|
|
50
|
+ 'string' => null
|
|
51
|
+ ));
|
|
52
|
+
|
|
53
|
+ $this->assertEquals($ua, $es->getParams());
|
|
54
|
+ }
|
55
|
55
|
|
56
|
56
|
protected function checkElementSearchResults($es_results, $array_names)
|
57
|
57
|
{
|
|
@@ -406,6 +406,23 @@ class ElementSearcherTest extends UnitTest
|
406
|
406
|
)
|
407
|
407
|
);
|
408
|
408
|
|
|
409
|
+ $es = new ElementSearcher();
|
|
410
|
+ $es->init(array(
|
|
411
|
+ 'network' => ElementSearcher::NETWORK_PUBLIC,
|
|
412
|
+ 'tags' => array(
|
|
413
|
+ $metal->getId() => 'Metal',
|
|
414
|
+ $hardcore->getId() => 'Hardcore',
|
|
415
|
+ $tribe->getId() => 'Tribe'
|
|
416
|
+ ),
|
|
417
|
+ 'count' => 5,
|
|
418
|
+ 'tag_strict' => true
|
|
419
|
+ ));
|
|
420
|
+
|
|
421
|
+ $this->checkElementSearchResults(
|
|
422
|
+ $es->getElements($r, $bux->getId()),
|
|
423
|
+ array()
|
|
424
|
+ );
|
|
425
|
+
|
409
|
426
|
}
|
410
|
427
|
|
411
|
428
|
}
|