Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / Fixtures / filters / length.test
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test
new file mode 100644 (file)
index 0000000..a7f1e50
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+"length" filter
+--TEMPLATE--
+{{ array|length }}
+{{ string|length }}
+{{ number|length }}
+{{ to_string_able|length }}
+{{ countable|length }}
+{{ null|length }}
+{{ magic|length }}
+{{ non_countable|length }}
+--DATA--
+return array(
+    'array' => array(1, 4),
+    'string' => 'foo',
+    'number' => 1000,
+    'to_string_able' => new ToStringStub('foobar'),
+    'countable' => new CountableStub(42),       /* also asserts we do *not* call __toString() */
+    'null'          => null,
+    'magic'         => new MagicCallStub(),     /* used to assert we do *not* call __call */
+    'non_countable' => new \StdClass(),
+);
+--EXPECT--
+2
+3
+4
+6
+42
+0
+1
+1