Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* allow `|length` of `null` * allow `|length` of objects not implementing `\Countable` * To get no errors when running with PHP 7.2 You need to use phpunit ^6.1, otherwise the `each` function, used by phpunit, triggers errors. You can do so by running phpunit like: `SYMFONY_PHPUNIT_VERSION=6.1 phpnightly vendor/bin/simple-phpunit` *
- Loading branch information
Hidde Boomsma
committed
May 8, 2017
1 parent
324ab87
commit d2b7a01
Showing
3 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--TEST-- | ||
"length" filter | ||
--TEMPLATE-- | ||
{{ null|length }} | ||
{{ magic|length }} | ||
{{ non_countable|length }} | ||
--DATA-- | ||
return array( | ||
'null' => null, /* triggers deprecation error */ | ||
'magic' => new MagicCallStub(), /* used to assert we do *not* call __call, also triggers deprecation */ | ||
'non_countable' => new \StdClass(), /* triggers deprecation error */ | ||
); | ||
--EXPECT-- | ||
0 | ||
1 | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters