summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test44
1 files changed, 33 insertions, 11 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test
index 19126fa..d54a7df 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/tests/views_handlers.test
@@ -2,9 +2,12 @@
/**
* @file
- * Test abstract handlers of views.
+ * Definition of ViewsHandlersTest.
*/
+/**
+ * Tests abstract handlers of views.
+ */
class ViewsHandlersTest extends ViewsSqlTest {
public static function getInfo() {
return array(
@@ -37,7 +40,7 @@ class ViewsHandlersTest extends ViewsSqlTest {
}
/**
- * Test views_break_phrase_string function.
+ * Tests views_break_phrase_string function.
*/
function test_views_break_phrase_string() {
$empty_stdclass = new stdClass();
@@ -52,28 +55,47 @@ class ViewsHandlersTest extends ViewsSqlTest {
$this->assertEqual($handler, views_break_phrase_string('', $handler));
// test ors
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1 word2+word', $handler));
+ $handler = views_break_phrase_string('word1 word2+word');
+ $this->assertEqualValue(array('word1', 'word2', 'word'), $handler);
+ $this->assertEqual('or', $handler->operator);
+ $handler = views_break_phrase_string('word1+word2+word');
+ $this->assertEqualValue(array('word1', 'word2', 'word'), $handler);
$this->assertEqual('or', $handler->operator);
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1+word2+word', $handler));
+ $handler = views_break_phrase_string('word1 word2 word');
+ $this->assertEqualValue(array('word1', 'word2', 'word'), $handler);
$this->assertEqual('or', $handler->operator);
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1 word2 word', $handler));
+ $handler = views_break_phrase_string('word-1+word-2+word');
+ $this->assertEqualValue(array('word-1', 'word-2', 'word'), $handler);
$this->assertEqual('or', $handler->operator);
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1 word2++word', $handler));
+ $handler = views_break_phrase_string('wõrd1+wõrd2+wõrd');
+ $this->assertEqualValue(array('wõrd1', 'wõrd2', 'wõrd'), $handler);
$this->assertEqual('or', $handler->operator);
// test ands.
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1,word2,word', $handler));
+ $handler = views_break_phrase_string('word1,word2,word');
+ $this->assertEqualValue(array('word1', 'word2', 'word'), $handler);
$this->assertEqual('and', $handler->operator);
- $this->assertEqualValue(array('word1', 'word2', 'word'), views_break_phrase_string('word1,,word2,word', $handler));
+ $handler = views_break_phrase_string('word1 word2,word');
+ $this->assertEqualValue(array('word1 word2', 'word'), $handler);
$this->assertEqual('and', $handler->operator);
- $this->assertEqualValue(array('word1 word2', 'word'), views_break_phrase_string('word1 word2,word', $handler));
+ $handler = views_break_phrase_string('word1,word2 word');
+ $this->assertEqualValue(array('word1', 'word2 word'), $handler);
$this->assertEqual('and', $handler->operator);
- $this->assertEqualValue(array('word1', 'word2 word'), views_break_phrase_string('word1,word2 word', $handler));
+ $handler = views_break_phrase_string('word-1,word-2,word');
+ $this->assertEqualValue(array('word-1', 'word-2', 'word'), $handler);
+ $this->assertEqual('and', $handler->operator);
+ $handler = views_break_phrase_string('wõrd1,wõrd2,wõrd');
+ $this->assertEqualValue(array('wõrd1', 'wõrd2', 'wõrd'), $handler);
+ $this->assertEqual('and', $handler->operator);
+
+ // test a single word
+ $handler = views_break_phrase_string('word');
+ $this->assertEqualValue(array('word'), $handler);
$this->assertEqual('and', $handler->operator);
}
/**
- * Test views_break_phrase function.
+ * Tests views_break_phrase function.
*/
function test_views_break_phrase() {
$empty_stdclass = new stdClass();