Security update to Drupal 8.4.6 with PHP held back to 7.0.27 to match the stoneboat...
[yaffs-website] / vendor / twig / twig / test / Twig / Tests / Fixtures / filters / length.test
1 --TEST--
2 "length" filter
3 --TEMPLATE--
4 {{ array|length }}
5 {{ string|length }}
6 {{ number|length }}
7 {{ to_string_able|length }}
8 {{ countable|length }}
9 {{ iterator_aggregate|length }}
10 {{ null|length }}
11 {{ magic|length }}
12 {{ non_countable|length }}
13 {{ simple_xml_element|length }}
14 --DATA--
15 return array(
16     'array' => array(1, 4),
17     'string' => 'foo',
18     'number' => 1000,
19     'to_string_able' => new ToStringStub('foobar'),
20     'countable' => new CountableStub(42),       /* also asserts we do *not* call __toString() */
21     'iterator_aggregate' => new IteratorAggregateStub(array('a', 'b', 'c')),   /* also asserts we do *not* call __toString() */
22     'null'          => null,
23     'magic'         => new MagicCallStub(),     /* used to assert we do *not* call __call */
24     'non_countable' => new \StdClass(),
25     'simple_xml_element' => new \SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><doc><elem/><elem/></doc>'),
26 );
27 --EXPECT--
28 2
29 3
30 4
31 6
32 42
33 3
34 0
35 1
36 1
37 2