Commit Graph

602 Commits

Author SHA1 Message Date
Martin Hasoň 4c26981ce5 Fixed "starts with" a "ends with" operators for non-string arguments 2014-08-02 17:11:21 +02:00
Fabien Potencier 0c508d2703 bug #1452 Fixed 'starts with' operator for empty needle (hason)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Fixed 'starts with' operator for empty needle

Fixes #1432

Commits
-------

790305a Fixed 'starts with' operator for empty needle
2014-08-01 17:28:52 +02:00
Martin Hasoň 790305af93 Fixed 'starts with' operator for empty needle 2014-08-01 14:43:36 +02:00
Fabien Potencier c03a7a323a fixed the attribute() function when passing a variable for the arguments 2014-08-01 09:18:16 +02:00
Fabien Potencier 72aa82b9a2 minor #1465 Some minor cleanup (JeroenDeDauw)
This PR was merged into the 1.16-dev branch.

Discussion
----------

Some minor cleanup

Commits
-------

e6da6bb Restore unused var
d8e1077 Get rid of naming clash
3e50672 Remove unused local vars
291141f Remove unused var
9921554 Fix type hint
1d2b877 Fix type hint
2014-07-31 15:21:40 +02:00
jeroendedauw 3e50672029 Remove unused local vars 2014-07-31 10:37:48 +02:00
jeroendedauw 1d2b8777d0 Fix type hint
PHPStorm wrongly inferred the type 'Unicode'
2014-07-31 10:36:30 +02:00
Martin Hasoň 632fe90000 Simplified Twig_Node_Include 2014-07-31 09:18:56 +02:00
Fabien Potencier eed777f8d8 replaced deprecated divisibleby by divisible by in tests 2014-07-05 14:12:06 +02:00
Fabien Potencier eeeef75f0a replaced deprecated sameas by same as in tests 2014-07-05 14:06:29 +02:00
Fabien Potencier 1930600e4e fixed url_encode when raw is false and URL is an array 2014-05-26 02:31:15 +02:00
Fabien Potencier f1aee16381 bug #1370 Fixed inheritance in a 'use'-hierarchy (hason)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Fixed inheritance in a 'use'-hierarchy

Fixes #1365

Commits
-------

9e0907e Fixed inheritance in a 'use'-hierarchy
2014-05-26 02:00:46 +02:00
Fabien Potencier 02b80626f0 bug #1382 Added isSandbox check around the __toString check in Sandbox extension (Scott Smith, smitherz82)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Added isSandbox check around the __toString check in Sandbox extension

The `__toString` policy check currently still happens when the sandbox is disabled

Commits
-------

3ce4202 Added test for sandbox __toString when not enabled
8dfa432 Added isSandbox check around the __toString check
2014-05-26 01:57:06 +02:00
Ulf 0db5c3100b [Twig][Tests][Fixtures][filters] Added empty string tests for "first" and "last" filters 2014-05-15 21:43:46 +02:00
Fabien Potencier cd4a372738 added some missing tests 2014-05-12 16:45:36 +02:00
Fabien Potencier 365feec87e made usage of return; instead of return null; 2014-04-16 12:37:16 +02:00
Scott Smith 3ce420284e Added test for sandbox __toString when not enabled 2014-04-15 19:03:53 +01:00
Martin Hasoň 9e0907e19a Fixed inheritance in a 'use'-hierarchy 2014-03-27 11:53:33 +01:00
Fabien Potencier 98903bb83f bug #1361 Fixed recursively calling blocks in templates with inheritance (hason)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Fixed recursively calling blocks in templates with inheritance

Replaces #1321
Fixes KnpLabs/KnpMenu#136 and KnpLabs/KnpMenu#119

Commits
-------

efb7b47 Add "broken" block inheritance test case
ef98ea2 Fixed recursively calling blocks in templates with inheritance
2014-03-15 11:49:13 +01:00
Adrien Brault efb7b479d3 Add "broken" block inheritance test case 2014-03-13 12:40:24 +01:00
Martin Hasoň ef98ea278a Fixed recursively calling blocks in templates with inheritance 2014-03-13 12:23:25 +01:00
Tugdual Saunier 6e800d8277 Fixed fetching of a property defined but not initialized in C extension, fixed #1337 2014-02-13 09:48:39 +00:00
Tobias Schultze bdbc56d385 added test for accessing xml attributes 2014-01-31 15:53:51 +01:00
Fabien Potencier e9e4748475 added a note about how to check for dynamic attribute existence in the docs 2014-01-29 09:45:07 +01:00
Fabien Potencier 4983af78f7 minor #1303 Improved exception message for accessing object (without ArrayAccess) as array (hason)
This PR was merged into the 1.15-dev branch.

Discussion
----------

Improved exception message for accessing object (without ArrayAccess) as array

Commits
-------

770712b Improved exception message for accessing object without ArrayAccess as array
2014-01-05 17:48:49 +01:00
Fabien Potencier e5e2a01051 made some minor tweaks to PHPUnit assertions 2014-01-05 17:26:18 +01:00
Martin Hasoň 770712b4c0 Improved exception message for accessing object without ArrayAccess as array 2013-12-31 22:30:37 +01:00
Fabien Potencier a2c6db7ea7 added an error message when trying to import an undefined block from a trait 2013-12-06 11:06:49 +01:00
Fabien Potencier 107fd201bf feature #1286 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception (fabpot)
This PR was merged into the master branch.

Discussion
----------

Adding ignoreStrictCheck option for call_user_func_array, if throwing exception

Same as #1236 with added unit tests and C extension support (to come).

"I experienced the issue when using FuelPHP's ORM with EAV containers. When I tried to reference a property that was not defined I expected to get null, but instead the whole application stopped because an exception was thrown in the ORM, that no such function is present.

I couldn't find other possible exception that could be thrown when this function is called, so I assumed it's safe to take the ignoreStrictCheck into consideration here."

Commits
-------

1abf5d9 [ext] Mirroring PHP change for call_user_func_array, see #1286
9ab290b added tests for exceptions thrown in __call()
c711d37 Adding ignoreStrictCheck option for call_user_func_array, if throwing exception
2013-12-03 15:08:30 +01:00
Fabien Potencier 9ab290bdb2 added tests for exceptions thrown in __call() 2013-12-03 14:14:58 +01:00
Grégoire Pineau 6aa06dea05 Added min and max function 2013-12-03 13:46:57 +01:00
Fabien Potencier f7c00d336f feature #1255 added the round filter (fabpot)
This PR was merged into the master branch.

Discussion
----------

added the round filter

fixes #1238

Commits
-------

ff4a7d2 added the round filter
2013-11-23 22:24:07 +01:00
ptarjan d40171701f Use string instead of large integer
HHVM differs from php-src on large integer parsing (php-src converts
them to floats, HHVM truncates them but leaves them as integers). The
point of this test is to make sure Twig parses it correctly, not the
underlying PHP execution engine.
2013-11-12 23:38:46 -08:00
Fabien Potencier ff4a7d29ac added the round filter 2013-11-12 08:49:56 +01:00
Fabien Potencier bdb5f8f02e bug #1258 Fix twig_first and twig_last filters for UTF8 multibyte strings (chEbba)
This PR was squashed before being merged into the master branch (closes #1258).

Discussion
----------

Fix twig_first and twig_last filters for UTF8 multibyte strings

After string is sliced we already have the right result with a first/last letter for UTF8 string.

Commits
-------

6003ae4 Fix twig_first and twig_last filters for UTF8 multibyte strings
2013-11-03 10:11:57 +01:00
Kirill chEbba Chebunin 6003ae43b9 Fix twig_first and twig_last filters for UTF8 multibyte strings 2013-11-03 10:11:57 +01:00
Fabien Potencier dff7d2c758 added a source function to include the content of a template without rendering it 2013-10-31 13:38:11 +01:00
Tugdual Saunier 40bba0e447 Fixed C extension sandbox behavior 2013-10-31 12:37:11 +01:00
Fabien Potencier 72f9bd8ab4 bug #1249 fixed error filename/line when an error occurs in an included file (fabpot)
This PR was merged into the master branch.

Discussion
----------

fixed error filename/line when an error occurs in an included file

fixed #1141

Commits
-------

ba0bf63 refactored some tests
1cdc913 fixed error filename/line when an error occurs in an included file
de985a8 failing test
2013-10-28 14:36:23 +01:00
Fabien Potencier 0294a1395b feature #1208 allowed tests to be made of 1 or 2 words (fabpot)
This PR was merged into the master branch.

Discussion
----------

allowed tests to be made of 1 or 2 words

Commits
-------

52c952c allowed tests to be made of 1 or 2 words
2013-10-28 11:44:48 +01:00
Fabien Potencier ba0bf636a8 refactored some tests 2013-10-27 19:42:36 +01:00
Kris Wallsmith de985a872f failing test
the error filename is incorrect when an exception is thrown from an
included file
2013-10-27 19:35:55 +01:00
Fabien Potencier 52c952c1a6 allowed tests to be made of 1 or 2 words 2013-10-27 19:31:19 +01:00
Fabien Potencier 724dc61bea allowed operators that contain whitespaces to have more than one whitespace 2013-10-27 10:57:04 +01:00
Fabien Potencier 8d805aacb8 made it possible to use named operators as variables 2013-10-15 18:35:22 +02:00
Fabien Potencier 6126457550 fixed the possibility to have a variable named 'matches' (closes #1227) 2013-10-15 18:09:36 +02:00
hidenorigoto ca61facb1a Added support DateTimeInterface (PHP 5.5) if available 2013-10-15 17:50:14 +02:00
Fabien Potencier 74586e9f08 Revert "merged branch hason/macros (PR #1139)"
This reverts commit 03926034c4, reversing
changes made to 730aa25bed.

Conflicts:
	CHANGELOG
	doc/tags/macro.rst
	doc/templates.rst
	lib/Twig/ExpressionParser.php
2013-10-02 21:50:59 +02:00
Fabien Potencier 60b575f979 Revert "fixed some unit tests"
This reverts commit 120518d803.
2013-10-02 21:46:31 +02:00
Fabien Potencier 606f88b1bc feature #1209 added the starts with, ends with, and matches operators (fabpot)
This PR was merged into the master branch.

Discussion
----------

added the starts with, ends with, and matches operators

Adds three new operators:

 * `ends with`
 * `starts with`
 * `matches`

I've not added the `contains` operator as it would be equivalent with the existing `in` one.

TODO:

 * [x] add docs
 * [x] fix on PHP 5.2.

Commits
-------

b66181d added the starts with, ends with, and matches operators
2013-10-02 21:38:09 +02:00