Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/tests/handlers/views_handler_filter_string.test | ||
---|---|---|
75 | 75 |
function testFilterStringEqual() { |
76 | 76 |
$view = $this->getBasicView(); |
77 | 77 |
|
78 |
// Change the filtering |
|
78 |
// Change the filtering.
|
|
79 | 79 |
$view->display['default']->handler->override_option('filters', array( |
80 | 80 |
'name' => array( |
81 | 81 |
'id' => 'name', |
... | ... | |
100 | 100 |
$filters = $this->getGroupedExposedFilters(); |
101 | 101 |
$view = $this->getBasicPageView(); |
102 | 102 |
|
103 |
// Filter: Name, Operator: =, Value: Ringo |
|
103 |
// Filter: Name, Operator: =, Value: Ringo.
|
|
104 | 104 |
$filters['name']['group_info']['default_group'] = 1; |
105 | 105 |
$view->set_display('page_1'); |
106 | 106 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
119 | 119 |
function testFilterStringNotEqual() { |
120 | 120 |
$view = $this->getBasicView(); |
121 | 121 |
|
122 |
// Change the filtering |
|
122 |
// Change the filtering.
|
|
123 | 123 |
$view->display['default']->handler->override_option('filters', array( |
124 | 124 |
'name' => array( |
125 | 125 |
'id' => 'name', |
... | ... | |
153 | 153 |
$filters = $this->getGroupedExposedFilters(); |
154 | 154 |
$view = $this->getBasicPageView(); |
155 | 155 |
|
156 |
// Filter: Name, Operator: !=, Value: Ringo |
|
156 |
// Filter: Name, Operator: !=, Value: Ringo.
|
|
157 | 157 |
$filters['name']['group_info']['default_group'] = '2'; |
158 | 158 |
|
159 | 159 |
$view->set_display('page_1'); |
... | ... | |
182 | 182 |
function testFilterStringContains() { |
183 | 183 |
$view = $this->getBasicView(); |
184 | 184 |
|
185 |
// Change the filtering |
|
185 |
// Change the filtering.
|
|
186 | 186 |
$view->display['default']->handler->override_option('filters', array( |
187 | 187 |
'name' => array( |
188 | 188 |
'id' => 'name', |
... | ... | |
208 | 208 |
$filters = $this->getGroupedExposedFilters(); |
209 | 209 |
$view = $this->getBasicPageView(); |
210 | 210 |
|
211 |
// Filter: Name, Operator: contains, Value: ing |
|
211 |
// Filter: Name, Operator: contains, Value: ing.
|
|
212 | 212 |
$filters['name']['group_info']['default_group'] = '3'; |
213 | 213 |
$view->set_display('page_1'); |
214 | 214 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
228 | 228 |
function testFilterStringWord() { |
229 | 229 |
$view = $this->getBasicView(); |
230 | 230 |
|
231 |
// Change the filtering |
|
231 |
// Change the filtering.
|
|
232 | 232 |
$view->display['default']->handler->override_option('filters', array( |
233 | 233 |
'description' => array( |
234 | 234 |
'id' => 'description', |
... | ... | |
254 | 254 |
|
255 | 255 |
$view = $this->getBasicView(); |
256 | 256 |
|
257 |
// Change the filtering |
|
257 |
// Change the filtering.
|
|
258 | 258 |
$view->display['default']->handler->override_option('filters', array( |
259 | 259 |
'description' => array( |
260 | 260 |
'id' => 'description', |
... | ... | |
277 | 277 |
|
278 | 278 |
|
279 | 279 |
function testFilterStringGroupedExposedWord() { |
280 |
$filters = $this->getGroupedExposedFilters();
|
|
280 |
$filters = $this->getGroupedExposedFilters(); |
|
281 | 281 |
$view = $this->getBasicPageView(); |
282 | 282 |
|
283 |
// Filter: Name, Operator: contains, Value: ing |
|
283 |
// Filter: Name, Operator: contains, Value: ing.
|
|
284 | 284 |
$filters['name']['group_info']['default_group'] = '3'; |
285 | 285 |
$view->set_display('page_1'); |
286 | 286 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
299 | 299 |
$filters = $this->getGroupedExposedFilters(); |
300 | 300 |
$view = $this->getBasicPageView(); |
301 | 301 |
|
302 |
// Filter: Description, Operator: contains, Value: actor |
|
302 |
// Filter: Description, Operator: contains, Value: actor.
|
|
303 | 303 |
$filters['description']['group_info']['default_group'] = '1'; |
304 | 304 |
$view->set_display('page_1'); |
305 | 305 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
319 | 319 |
function testFilterStringStarts() { |
320 | 320 |
$view = $this->getBasicView(); |
321 | 321 |
|
322 |
// Change the filtering |
|
322 |
// Change the filtering.
|
|
323 | 323 |
$view->display['default']->handler->override_option('filters', array( |
324 | 324 |
'description' => array( |
325 | 325 |
'id' => 'description', |
... | ... | |
344 | 344 |
$filters = $this->getGroupedExposedFilters(); |
345 | 345 |
$view = $this->getBasicPageView(); |
346 | 346 |
|
347 |
// Filter: Name, Operator: starts, Value: George |
|
347 |
// Filter: Name, Operator: starts, Value: George.
|
|
348 | 348 |
$filters['description']['group_info']['default_group'] = 2; |
349 | 349 |
$view->set_display('page_1'); |
350 | 350 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
362 | 362 |
function testFilterStringNotStarts() { |
363 | 363 |
$view = $this->getBasicView(); |
364 | 364 |
|
365 |
// Change the filtering |
|
365 |
// Change the filtering.
|
|
366 | 366 |
$view->display['default']->handler->override_option('filters', array( |
367 | 367 |
'description' => array( |
368 | 368 |
'id' => 'description', |
... | ... | |
385 | 385 |
array( |
386 | 386 |
'name' => 'Paul', |
387 | 387 |
), |
388 |
// There is no Meredith returned because his description is empty |
|
388 |
// There is no Meredith returned because his description is empty.
|
|
389 | 389 |
); |
390 | 390 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
391 | 391 |
} |
... | ... | |
394 | 394 |
$filters = $this->getGroupedExposedFilters(); |
395 | 395 |
$view = $this->getBasicPageView(); |
396 | 396 |
|
397 |
// Filter: Name, Operator: not_starts, Value: George |
|
397 |
// Filter: Name, Operator: not_starts, Value: George.
|
|
398 | 398 |
$filters['description']['group_info']['default_group'] = 3; |
399 | 399 |
$view->set_display('page_1'); |
400 | 400 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
411 | 411 |
array( |
412 | 412 |
'name' => 'Paul', |
413 | 413 |
), |
414 |
// There is no Meredith returned because his description is empty |
|
414 |
// There is no Meredith returned because his description is empty.
|
|
415 | 415 |
); |
416 | 416 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
417 | 417 |
} |
... | ... | |
419 | 419 |
function testFilterStringEnds() { |
420 | 420 |
$view = $this->getBasicView(); |
421 | 421 |
|
422 |
// Change the filtering |
|
422 |
// Change the filtering.
|
|
423 | 423 |
$view->display['default']->handler->override_option('filters', array( |
424 | 424 |
'description' => array( |
425 | 425 |
'id' => 'description', |
... | ... | |
447 | 447 |
$filters = $this->getGroupedExposedFilters(); |
448 | 448 |
$view = $this->getBasicPageView(); |
449 | 449 |
|
450 |
// Filter: Descriptino, Operator: ends, Value: Beatles |
|
450 |
// Filter: Descriptino, Operator: ends, Value: Beatles.
|
|
451 | 451 |
$filters['description']['group_info']['default_group'] = 4; |
452 | 452 |
$view->set_display('page_1'); |
453 | 453 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
468 | 468 |
function testFilterStringNotEnds() { |
469 | 469 |
$view = $this->getBasicView(); |
470 | 470 |
|
471 |
// Change the filtering |
|
471 |
// Change the filtering.
|
|
472 | 472 |
$view->display['default']->handler->override_option('filters', array( |
473 | 473 |
'description' => array( |
474 | 474 |
'id' => 'description', |
... | ... | |
488 | 488 |
array( |
489 | 489 |
'name' => 'Paul', |
490 | 490 |
), |
491 |
// There is no Meredith returned because his description is empty |
|
491 |
// There is no Meredith returned because his description is empty.
|
|
492 | 492 |
); |
493 | 493 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
494 | 494 |
} |
... | ... | |
497 | 497 |
$filters = $this->getGroupedExposedFilters(); |
498 | 498 |
$view = $this->getBasicPageView(); |
499 | 499 |
|
500 |
// Filter: Description, Operator: not_ends, Value: Beatles |
|
500 |
// Filter: Description, Operator: not_ends, Value: Beatles.
|
|
501 | 501 |
$filters['description']['group_info']['default_group'] = 5; |
502 | 502 |
$view->set_display('page_1'); |
503 | 503 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
511 | 511 |
array( |
512 | 512 |
'name' => 'Paul', |
513 | 513 |
), |
514 |
// There is no Meredith returned because his description is empty |
|
514 |
// There is no Meredith returned because his description is empty.
|
|
515 | 515 |
); |
516 | 516 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
517 | 517 |
} |
... | ... | |
519 | 519 |
function testFilterStringNot() { |
520 | 520 |
$view = $this->getBasicView(); |
521 | 521 |
|
522 |
// Change the filtering |
|
522 |
// Change the filtering.
|
|
523 | 523 |
$view->display['default']->handler->override_option('filters', array( |
524 | 524 |
'description' => array( |
525 | 525 |
'id' => 'description', |
... | ... | |
539 | 539 |
array( |
540 | 540 |
'name' => 'Paul', |
541 | 541 |
), |
542 |
// There is no Meredith returned because his description is empty |
|
542 |
// There is no Meredith returned because his description is empty.
|
|
543 | 543 |
); |
544 | 544 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
545 | 545 |
} |
... | ... | |
549 | 549 |
$filters = $this->getGroupedExposedFilters(); |
550 | 550 |
$view = $this->getBasicPageView(); |
551 | 551 |
|
552 |
// Filter: Description, Operator: not (does not contains), Value: Beatles |
|
552 |
// Filter: Description, Operator: not (does not contains), Value: Beatles.
|
|
553 | 553 |
$filters['description']['group_info']['default_group'] = 6; |
554 | 554 |
$view->set_display('page_1'); |
555 | 555 |
$view->display['page_1']->handler->override_option('filters', $filters); |
... | ... | |
563 | 563 |
array( |
564 | 564 |
'name' => 'Paul', |
565 | 565 |
), |
566 |
// There is no Meredith returned because his description is empty |
|
566 |
// There is no Meredith returned because his description is empty.
|
|
567 | 567 |
); |
568 | 568 |
$this->assertIdenticalResultset($view, $resultset, $this->column_map); |
569 | 569 |
|
... | ... | |
572 | 572 |
function testFilterStringShorter() { |
573 | 573 |
$view = $this->getBasicView(); |
574 | 574 |
|
575 |
// Change the filtering |
|
575 |
// Change the filtering.
|
|
576 | 576 |
$view->display['default']->handler->override_option('filters', array( |
577 | 577 |
'name' => array( |
578 | 578 |
'id' => 'name', |
... | ... | |
620 | 620 |
function testFilterStringLonger() { |
621 | 621 |
$view = $this->getBasicView(); |
622 | 622 |
|
623 |
// Change the filtering |
|
623 |
// Change the filtering.
|
|
624 | 624 |
$view->display['default']->handler->override_option('filters', array( |
625 | 625 |
'name' => array( |
626 | 626 |
'id' => 'name', |
... | ... | |
663 | 663 |
function testFilterStringEmpty() { |
664 | 664 |
$view = $this->getBasicView(); |
665 | 665 |
|
666 |
// Change the filtering |
|
666 |
// Change the filtering.
|
|
667 | 667 |
$view->display['default']->handler->override_option('filters', array( |
668 | 668 |
'description' => array( |
669 | 669 |
'id' => 'description', |
... | ... | |
687 | 687 |
$filters = $this->getGroupedExposedFilters(); |
688 | 688 |
$view = $this->getBasicPageView(); |
689 | 689 |
|
690 |
// Filter: Description, Operator: empty, Value:
|
|
690 |
// Filter: Description, Operator: empty, Value.
|
|
691 | 691 |
$filters['description']['group_info']['default_group'] = 7; |
692 | 692 |
$view->set_display('page_1'); |
693 | 693 |
$view->display['page_1']->handler->override_option('filters', $filters); |
Formats disponibles : Unified diff
Weekly update of contrib modules