diff --git a/.github/build-packages.php b/.github/build-packages.php
index ec629998f600d..02a2239732be2 100644
--- a/.github/build-packages.php
+++ b/.github/build-packages.php
@@ -43,16 +43,20 @@
echo "Missing \"dev-master\" branch-alias in composer.json extra.\n";
exit(1);
}
- $package->version = str_replace('-dev', '.999', $package->extra->{'branch-alias'}->{'dev-master'});
+ $package->version = str_replace('-dev', '.x-dev', $package->extra->{'branch-alias'}->{'dev-master'});
$package->dist['type'] = 'tar';
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";
$packages[$package->name][$package->version] = $package;
$versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json');
- $versions = json_decode($versions);
+ $versions = json_decode($versions)->package->versions;
- foreach ($versions->package->versions as $v => $package) {
+ if ($package->version === str_replace('-dev', '.x-dev', $versions->{'dev-master'}->extra->{'branch-alias'}->{'dev-master'})) {
+ unset($versions->{'dev-master'});
+ }
+
+ foreach ($versions as $v => $package) {
$packages[$package->name] += array($v => $package);
}
}
diff --git a/.php_cs b/.php_cs.dist
similarity index 77%
rename from .php_cs
rename to .php_cs.dist
index 5a702adb3a838..bbb62c2d3cdce 100644
--- a/.php_cs
+++ b/.php_cs.dist
@@ -1,15 +1,17 @@
setUsingLinter(false)
- ->setUsingCache(true)
- ->fixers(array(
- 'long_array_syntax',
- 'php_unit_construct',
- 'php_unit_dedicate_assert',
+return PhpCsFixer\Config::create()
+ ->setRules(array(
+ '@Symfony' => true,
+ '@Symfony:risky' => true,
+ 'array_syntax' => array('syntax' => 'long'),
+ 'no_unreachable_default_argument_value' => false,
+ 'braces' => array('allow_single_line_closure' => true),
+ 'heredoc_to_nowdoc' => false,
))
- ->finder(
- Symfony\CS\Finder\DefaultFinder::create()
+ ->setRiskyAllowed(true)
+ ->setFinder(
+ PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(array(
// directories containing files with content that is autogenerated by `var_export`, which breaks CS in output code
diff --git a/.travis.yml b/.travis.yml
index 70e364f8f960d..93ec75cd0a4e8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -18,7 +18,7 @@ env:
matrix:
include:
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
- - php: hhvm-stable
+ - php: hhvm-3.15
sudo: required
dist: trusty
group: edge
@@ -78,14 +78,15 @@ install:
- if [[ ! $skip && $deps ]]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi
- if [[ ! $skip && $deps ]]; then mv composer.json.phpunit composer.json; fi
- if [[ ! $skip ]]; then composer update; fi
- - if [[ ! $skip ]]; then COMPOSER_ROOT_VERSION= ./phpunit install; fi
+ - if [[ ! $skip ]]; then ./phpunit install; fi
- if [[ ! $skip && ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
script:
+ - REPORT=' && echo -e "\\e[32mOK\\e[0m {}\\n\\n" || (echo -e "\\e[41mKO\\e[0m {}\\n\\n" && $(exit 1))'
- if [[ $skip ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"; fi
- - if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi
+ - if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'"$REPORT"; fi
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi
- - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi
- - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi
+ - if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY"$REPORT"; fi
+ - if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'"$REPORT"; fi
diff --git a/CHANGELOG-2.7.md b/CHANGELOG-2.7.md
index ff7d6301ddcc4..df5011ef69c67 100644
--- a/CHANGELOG-2.7.md
+++ b/CHANGELOG-2.7.md
@@ -7,6 +7,43 @@ in 2.7 minor versions.
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.7.0...v2.7.1
+* 2.7.23 (2017-01-12)
+
+ * bug #21218 [Form] DateTimeToLocalizedStringTransformer does not use timezone when using date only (magnetik)
+ * bug #21104 [FrameworkBundle] fix IPv6 address handling in server commands (xabbuh)
+ * bug #20793 [Validator] Fix caching of constraints derived from non-serializable parents (uwej711)
+ * bug #19586 [TwigBundle] Fix bug where namespaced paths don't take parent bundles in account (wesleylancel)
+ * bug #21237 [FrameworkBundle] Fix relative paths used as cache keys (nicolas-grekas)
+ * bug #21183 [Validator] respect groups when merging constraints (xabbuh)
+ * bug #21179 [TwigBundle] Fixing regression in TwigEngine exception handling (Bertalan Attila)
+ * bug #21220 [DI] Fix missing new line after private alias (ogizanagi)
+ * bug #21211 Classloader tmpname (lyrixx)
+ * bug #21205 [TwigBundle] fixed usage when Templating is not installed (fabpot)
+ * bug #21155 [Validator] Check cascasdedGroups for being countable (scaytrase)
+ * bug #21200 [Filesystem] Check that directory is writable after created it in dumpFile() (chalasr)
+ * bug #21113 [FrameworkBundle][HttpKernel] Fix resources loading for bundles with custom structure (chalasr)
+ * bug #21084 [Yaml] handle empty lines inside unindented collection (xabbuh)
+ * bug #20925 [HttpFoundation] Validate/cast cookie expire time (ro0NL)
+ * bug #21032 [SecurityBundle] Made collection of user provider unique when injecting them to the RemberMeService (lyrixx)
+ * bug #21078 [Console] Escape default value when dumping help (lyrixx)
+ * bug #21076 [Console] OS X Can't call cli_set_process_title php without superuser (ogizanagi)
+ * bug #20900 [Console] Descriptors should use Helper::strlen (ogizanagi)
+ * bug #21064 [Debug] Wrap call to ->log in a try catch block (lyrixx)
+ * bug #21010 [Debug] UndefinedMethodFatalErrorHandler - Handle anonymous classes (SpacePossum)
+ * bug #20859 Avoid warning in PHP 7.2 because of non-countable data (wouterj)
+ * bug #21053 [Validator] override property constraints in child class (xabbuh)
+ * bug #20970 [Console] Fix question formatting using SymfonyStyle::ask() (chalasr, ogizanagi)
+ * bug #20975 [Form] fix group sequence based validation (xabbuh)
+ * bug #20599 [WebProfilerBundle] Display multiple HTTP headers in WDT (ro0NL)
+ * bug #20799 [TwigBundle] do not try to register incomplete definitions (xabbuh)
+ * bug #20961 [Validator] phpize default option values (xabbuh)
+ * bug #20934 [FrameworkBundle] Fix PHP form templates on translatable attributes (ro0NL)
+ * bug #20957 [FrameworkBundle] test for the Validator component to be present (xabbuh)
+ * bug #20936 [DependencyInjection] Fix on-invalid attribute type in xsd (ogizanagi)
+ * bug #20931 [VarDumper] Fix dumping by-ref variadics (nicolas-grekas)
+ * bug #20734 [Security] AbstractVoter->supportsAttribute gives false positive if attribute is zero (0) (martynas-foodpanda)
+ * bug #14082 [config] Fix issue when key removed and left value only (zerustech)
+
* 2.7.22 (2016-12-13)
* bug #20714 [FrameworkBundle] Fix unresolved parameters from default configs in debug:config (chalasr)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ae18925cb6e20..7902d9aff3a77 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -5,6 +5,7 @@ Symfony is an open source, community-driven project.
If you'd like to contribute, please read the following documents:
+* [Reviewing issues/pull requests][0]
* [Reporting a Bug][1]
* [Submitting a Patch][2]
* [Symfony Core Team][3]
@@ -14,6 +15,7 @@ If you'd like to contribute, please read the following documents:
* [Coding Standards][7]
* [Conventions][8]
+[0]: https://symfony.com/doc/current/contributing/community/reviews.html
[1]: https://symfony.com/doc/current/contributing/code/bugs.html
[2]: https://symfony.com/doc/current/contributing/code/patches.html
[3]: https://symfony.com/doc/current/contributing/code/core_team.html
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 24f9845d0b517..f740b56abf6f9 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -27,18 +27,18 @@ Symfony is the result of the work of many people who made the code better
- Karma Dordrak (drak)
- Lukas Kahwe Smith (lsmith)
- Martin Hasoň (hason)
- - Jeremy Mikola (jmikola)
- Grégoire Pineau (lyrixx)
+ - Jeremy Mikola (jmikola)
- Jean-François Simon (jfsimon)
- Benjamin Eberlei (beberlei)
- Igor Wiedler (igorw)
- Eriksen Costa (eriksencosta)
- - Jules Pietri (heah)
- Maxime Steinhausser (ogizanagi)
+ - Jules Pietri (heah)
+ - Robin Chalas (chalas_r)
- Sarah Khalil (saro0h)
- Jonathan Wage (jwage)
- Diego Saint Esteben (dosten)
- - Robin Chalas (chalas_r)
- Alexandre Salomé (alexandresalome)
- William Durand (couac)
- ornicar
@@ -49,11 +49,12 @@ Symfony is the result of the work of many people who made the code better
- Saša Stamenković (umpirsky)
- Henrik Bjørnskov (henrikbjorn)
- Miha Vrhovnik
- - Diego Saint Esteben (dii3g0)
- Ener-Getick (energetick)
+ - Diego Saint Esteben (dii3g0)
- Konstantin Kudryashov (everzet)
- - Bilal Amarni (bamarni)
- Iltar van der Berg (kjarli)
+ - Roland Franssen (ro0)
+ - Bilal Amarni (bamarni)
- Florin Patan (florinpatan)
- Peter Rehm (rpet)
- Kevin Bond (kbond)
@@ -69,19 +70,18 @@ Symfony is the result of the work of many people who made the code better
- Henrik Westphal (snc)
- Dariusz Górecki (canni)
- Douglas Greenshields (shieldo)
+ - Titouan Galopin (tgalopin)
- Konstantin Myakshin (koc)
- Lee McDermott
- Brandon Turner
- Luis Cordova (cordoval)
- Graham Campbell (graham)
- - Titouan Galopin (tgalopin)
- Daniel Holmes (dholmes)
- Pierre du Plessis (pierredup)
- Toni Uebernickel (havvg)
- Bart van den Burg (burgov)
- Jordan Alliot (jalliot)
- John Wards (johnwards)
- - Roland Franssen (ro0)
- Fran Moreno (franmomu)
- Jáchym Toušek (enumag)
- Antoine Hérault (herzult)
@@ -98,6 +98,7 @@ Symfony is the result of the work of many people who made the code better
- lenar
- Włodzimierz Gajda (gajdaw)
- Baptiste Clavié (talus)
+ - Maxime STEINHAUSSER
- Alexander Schwenn (xelaris)
- Florian Voutzinos (florianv)
- Colin Frei
@@ -114,13 +115,13 @@ Symfony is the result of the work of many people who made the code better
- Eric GELOEN (gelo)
- David Buchmann (dbu)
- Tugdual Saunier (tucksaun)
- - Maxime STEINHAUSSER
- Théo FIDRY (theofidry)
- Robert Schönthal (digitalkaoz)
- Florian Lonqueu-Brochard (florianlb)
- Stefano Sala (stefano.sala)
- Evgeniy (ewgraf)
- Juti Noppornpitak (shiroyuki)
+ - Tobias Nyholm (tobias)
- Tigran Azatyan (tigranazatyan)
- Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes)
@@ -130,12 +131,11 @@ Symfony is the result of the work of many people who made the code better
- Pablo Godel (pgodel)
- Jérémie Augustin (jaugustin)
- Andréia Bohner (andreia)
+ - Yonel Ceruto González (yonelceruto)
- Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom)
- jwdeitch
- - Tobias Nyholm (tobias)
- Joel Wurtz (brouznouf)
- - Yonel Ceruto González (yonelceruto)
- Philipp Wahala (hifi)
- Vyacheslav Pavlov
- Javier Spagnoletti (phansys)
@@ -179,6 +179,7 @@ Symfony is the result of the work of many people who made the code better
- fivestar
- Dominique Bongiraud
- Jeremy Livingston (jeremylivingston)
+ - Michael Lee (zerustech)
- Matthieu Auger (matthieuauger)
- Leszek Prabucki (l3l0)
- François Zaninotto (fzaninotto)
@@ -187,6 +188,7 @@ Symfony is the result of the work of many people who made the code better
- John Kary (johnkary)
- Justin Hileman (bobthecow)
- Blanchon Vincent (blanchonvincent)
+ - Chris Wilkinson (thewilkybarkid)
- Michele Orselli (orso)
- Tom Van Looy (tvlooy)
- Sven Paulus (subsven)
@@ -195,6 +197,7 @@ Symfony is the result of the work of many people who made the code better
- Dawid Nowak
- Eugene Wissner
- Julien Brochet (mewt)
+ - Tristan Darricau (nicofuma)
- Sergey Linnik (linniksa)
- Michaël Perrin (michael.perrin)
- Marcel Beerta (mazen)
@@ -202,7 +205,6 @@ Symfony is the result of the work of many people who made the code better
- Jannik Zschiesche (apfelbox)
- Marco Pivetta (ocramius)
- julien pauli (jpauli)
- - Michael Lee (zerustech)
- Lorenz Schori
- Sébastien Lavoie (lavoiesl)
- Francois Zaninotto
@@ -216,20 +218,20 @@ Symfony is the result of the work of many people who made the code better
- Roman Marintšenko (inori)
- Christian Schmidt
- Xavier Montaña Carreras (xmontana)
- - Chris Wilkinson (thewilkybarkid)
- Mickaël Andrieu (mickaelandrieu)
- Xavier Perez
- Arjen Brouwer (arjenjb)
- Katsuhiro OGAWA
+ - Patrick McDougle (patrick-mcdougle)
- James Halsall (jaitsu)
- Alif Rachmawadi
- Kristen Gilden (kgilden)
+ - SpacePossum
- Pierre-Yves LEBECQ (pylebecq)
- Alex Pott
- Jakub Kucharovic (jkucharovic)
- Eugene Leonovich (rybakit)
- Filippo Tessarotto
- - Tristan Darricau (nicofuma)
- Joseph Rouff (rouffj)
- Félix Labrecque (woodspire)
- GordonsLondon
@@ -259,7 +261,6 @@ Symfony is the result of the work of many people who made the code better
- Peter Kruithof (pkruithof)
- Michael Holm (hollo)
- Marc Weistroff (futurecat)
- - SpacePossum
- Hidde Wieringa (hiddewie)
- Chris Smith (cs278)
- Florian Klein (docteurklein)
@@ -278,12 +279,14 @@ Symfony is the result of the work of many people who made the code better
- Ismael Ambrosi (iambrosi)
- Uwe Jäger (uwej711)
- Aurelijus Valeiša (aurelijus)
+ - Victor Bocharsky (bocharsky_bw)
- Jan Decavele (jandc)
- Gustavo Piltcher
- Stepan Tanasiychuk (stfalcon)
- Tiago Ribeiro (fixe)
- Hidde Boomsma (hboomsma)
- John Bafford (jbafford)
+ - Pavel Batanov (scaytrase)
- Bob den Otter (bopp)
- Adrian Rudnik (kreischweide)
- Francesc Rosàs (frosas)
@@ -304,6 +307,7 @@ Symfony is the result of the work of many people who made the code better
- Matthew Lewinski (lewinski)
- Magnus Nordlander (magnusnordlander)
- alquerci
+ - Adam Prager (padam87)
- Francesco Levorato
- Vitaliy Zakharov (zakharovvi)
- Tobias Sjösten (tobiassjosten)
@@ -324,6 +328,7 @@ Symfony is the result of the work of many people who made the code better
- Clément Gautier (clementgautier)
- Eduardo Gulias (egulias)
- giulio de donato (liuggio)
+ - ShinDarth
- Stéphane PY (steph_py)
- Philipp Kräutli (pkraeutli)
- Kirill chEbba Chebunin (chebba)
@@ -336,9 +341,9 @@ Symfony is the result of the work of many people who made the code better
- Hassan Amouhzi
- Tamas Szijarto
- Pavel Volokitin (pvolok)
+ - François Pluchino (francoispluchino)
- Nicolas Dewez (nicolas_dewez)
- Endre Fejes
- - Victor Bocharsky (bocharsky_bw)
- Tobias Naumann (tna)
- Daniel Beyer
- Shein Alexey
@@ -355,7 +360,6 @@ Symfony is the result of the work of many people who made the code better
- Xavier HAUSHERR
- Albert Jessurum (ajessu)
- Laszlo Korte
- - Pavel Batanov (scaytrase)
- Miha Vrhovnik
- Alessandro Desantis
- hubert lecorche (hlecorche)
@@ -412,6 +416,7 @@ Symfony is the result of the work of many people who made the code better
- boombatower
- Fabrice Bernhard (fabriceb)
- Jérôme Macias (jeromemacias)
+ - Andrey Astakhov (aast)
- Fabian Lange (codingfabian)
- Frank Neff (fneff)
- Roman Lapin (memphys)
@@ -422,6 +427,7 @@ Symfony is the result of the work of many people who made the code better
- Pablo Díez (pablodip)
- Kevin McBride
- Sergio Santoro
+ - Robin van der Vleuten (robinvdvleuten)
- Philipp Rieber (bicpi)
- Manuel de Ruiter (manuel)
- Eduardo Oliveira (entering)
@@ -478,7 +484,6 @@ Symfony is the result of the work of many people who made the code better
- Alexander Deruwe (aderuwe)
- Alain Hippolyte (aloneh)
- Dave Hulbert (dave1010)
- - François Pluchino (francoispluchino)
- Ivan Rey (ivanrey)
- Marcin Chyłek (songoq)
- Ned Schwartz
@@ -512,6 +517,7 @@ Symfony is the result of the work of many people who made the code better
- Konstantin S. M. Möllers (ksmmoellers)
- Sinan Eldem
- Alexandre Dupuy (satchette)
+ - Rob Frawley 2nd
- Nahuel Cuesta (ncuesta)
- Chris Boden (cboden)
- Asmir Mustafic (goetas)
@@ -522,6 +528,7 @@ Symfony is the result of the work of many people who made the code better
- Åsmund Garfors
- Maxime Douailin
- Jean Pasdeloup (pasdeloup)
+ - Benjamin Cremer (bcremer)
- Javier López (loalf)
- Andreas Braun
- Reinier Kip
@@ -551,7 +558,6 @@ Symfony is the result of the work of many people who made the code better
- umpirski
- Chris Heng (gigablah)
- Ulumuddin Yunus (joenoez)
- - Adam Prager (padam87)
- Luc Vieillescazes (iamluc)
- Johann Saunier (prophet777)
- Samuel ROZE (sroze)
@@ -586,6 +592,7 @@ Symfony is the result of the work of many people who made the code better
- develop
- ReenExe
- Mark Sonnabaum
+ - Thomas Royer (cydonia7)
- Richard Quadling
- jochenvdv
- Arturas Smorgun (asarturas)
@@ -593,6 +600,7 @@ Symfony is the result of the work of many people who made the code better
- Michael Piecko
- yclian
- twifty
+ - Indra Gunawan (guind)
- Peter Ward
- Julien DIDIER (juliendidier)
- Dominik Ritter (dritter)
@@ -600,10 +608,10 @@ Symfony is the result of the work of many people who made the code better
- Martin Hujer (martinhujer)
- Pascal Helfenstein
- Baldur Rensch (brensch)
+ - Thomas Calvet
- Vladyslav Petrovych
- Alex Xandra Albert Sim
- Carson Full
- - Andrey Astakhov (aast)
- Trent Steel (trsteel88)
- Yuen-Chi Lian
- Besnik Br
@@ -630,11 +638,13 @@ Symfony is the result of the work of many people who made the code better
- Christian Soronellas (theunic)
- Romain Gautier (mykiwi)
- Yosmany Garcia (yosmanyga)
+ - Wouter J
- Wouter de Wild
- Miroslav Sustek
- Degory Valentine
- Benoit Lévêque (benoit_leveque)
- Jeroen Fiege (fieg)
+ - Arthur de Moulins (4rthem)
- Krzysiek Łabuś
- Xavier Lacot (xavier)
- possum
@@ -642,6 +652,7 @@ Symfony is the result of the work of many people who made the code better
- Olivier Maisonneuve (olineuve)
- Masterklavi
- Francis Turmel (fturmel)
+ - Nikita Nefedov (nikita2206)
- cgonzalez
- Ben
- Jayson Xu (superjavason)
@@ -683,8 +694,10 @@ Symfony is the result of the work of many people who made the code better
- Ivan Menshykov
- David Romaní
- Patrick Allaert
+ - Fabien Bourigault (fbourigault)
- Gustavo Falco (gfalco)
- Matt Robinson (inanimatt)
+ - Ruud Kamphuis (ruudk)
- Aleksey Podskrebyshev
- Calin Mihai Pristavu
- David Marín Carreño (davefx)
@@ -734,7 +747,6 @@ Symfony is the result of the work of many people who made the code better
- Mikhail Yurasov (mym)
- LOUARDI Abdeltif (ouardisoft)
- Robert Gruendler (pulse00)
- - Robin van der Vleuten (robinvdvleuten)
- Simon Terrien (sterrien)
- Benoît Merlet (trompette)
- Koen Kuipers
@@ -763,6 +775,7 @@ Symfony is the result of the work of many people who made the code better
- Colin O'Dell (colinodell)
- xaav
- Mahmoud Mostafa (mahmoud)
+ - Alessandro Lai
- Pieter
- Michael Tibben
- Sander Marechal
@@ -811,8 +824,10 @@ Symfony is the result of the work of many people who made the code better
- Nicolas Macherey
- Lin Clark
- Jeremy David (jeremy.david)
+ - Denis Brumann (dbrumann)
- Troy McCabe
- Ville Mattila
+ - ilyes kooli
- Boris Vujicic (boris.vujicic)
- Max Beutel
- Antanas Arvasevicius
@@ -832,6 +847,7 @@ Symfony is the result of the work of many people who made the code better
- Christian
- Sergii Smertin (nfx)
- hugofonseca (fonsecas72)
+ - Martynas Narbutas
- Bailey Parker
- Eddie Jaoude
- Haritz Iturbe (hizai)
@@ -846,7 +862,6 @@ Symfony is the result of the work of many people who made the code better
- Alex Demchenko (pilot)
- Tadas Gliaubicas (tadcka)
- Benoit Garret
- - Thomas Royer (cydonia7)
- DerManoMann
- Olaf Klischat
- orlovv
@@ -867,7 +882,6 @@ Symfony is the result of the work of many people who made the code better
- rpg600
- Péter Buri (burci)
- Davide Borsatto (davide.borsatto)
- - Indra Gunawan (guind)
- kaiwa
- Charles Sanquer (csanquer)
- Albert Ganiev (helios-ag)
@@ -909,6 +923,7 @@ Symfony is the result of the work of many people who made the code better
- Krzysztof Przybyszewski
- Paul Matthews
- Juan Traverso
+ - Tarjei Huse (tarjei)
- Philipp Strube
- Christian Sciberras
- Clement Herreman (clemherreman)
@@ -919,7 +934,6 @@ Symfony is the result of the work of many people who made the code better
- Alberto Aldegheri
- heccjj
- Alexandre Melard
- - Thomas Calvet
- Sergey Yuferev
- Tobias Stöckler
- Mario Young
@@ -973,6 +987,7 @@ Symfony is the result of the work of many people who made the code better
- Samuel Vogel (samuelvogel)
- Berat Doğan
- Juanmi Rodriguez Cerón
+ - Andy Raines
- Anthony Ferrara
- Klaas Cuvelier (kcuvelier)
- Steve Frécinaux
@@ -998,6 +1013,7 @@ Symfony is the result of the work of many people who made the code better
- Alberto Pirovano (geezmo)
- Pete Mitchell (peterjmit)
- Tom Corrigan (tomcorrigan)
+ - Luis Galeas
- Martin Pärtel
- Noah Heck (myesain)
- Patrick Daley (padrig)
@@ -1014,7 +1030,6 @@ Symfony is the result of the work of many people who made the code better
- Romain Geissler
- Adrien Moiruad
- Tomaz Ahlin
- - Benjamin Cremer (bcremer)
- Marcus Stöhr (dafish)
- Emmanuel Vella (emmanuel.vella)
- Carsten Nielsen (phreaknerd)
@@ -1036,6 +1051,7 @@ Symfony is the result of the work of many people who made the code better
- Damien Tournoud
- Jon Gotlin (jongotlin)
- Michael Dowling (mtdowling)
+ - Karlos Presumido (oneko)
- BilgeXA
- r1pp3rj4ck
- Robert Queck
@@ -1073,7 +1089,6 @@ Symfony is the result of the work of many people who made the code better
- kor3k kor3k (kor3k)
- Stelian Mocanita (stelian)
- Flavian (2much)
- - Arthur de Moulins (4rthem)
- mike
- Keith Maika
- Mephistofeles
@@ -1164,6 +1179,7 @@ Symfony is the result of the work of many people who made the code better
- Julius Beckmann
- Romain Dorgueil
- Grayson Koonce (breerly)
+ - Fabien LUCAS (flucas2)
- Karim Cassam Chenaï (ka)
- Nicolas Bastien (nicolas_bastien)
- Denis (yethee)
@@ -1212,7 +1228,6 @@ Symfony is the result of the work of many people who made the code better
- Bram Van der Sype (brammm)
- Guile (guile)
- Julien Moulin (lizjulien)
- - Nikita Nefedov (nikita2206)
- Mauro Foti (skler)
- Yannick Warnier (ywarnier)
- Kevin Decherf
@@ -1235,7 +1250,9 @@ Symfony is the result of the work of many people who made the code better
- Tischoi
- J Bruni
- Alexey Prilipko
+ - vlakoff
- bertillon
+ - Bertalan Attila
- Yannick Bensacq (cibou)
- Luca Genuzio (genuzio)
- Hans Nilsson (hansnilsson)
@@ -1254,7 +1271,6 @@ Symfony is the result of the work of many people who made the code better
- Joel Marcey
- David Christmann
- root
- - Wouter J
- James Hudson
- Tom Maguire
- David Zuelke
@@ -1309,9 +1325,9 @@ Symfony is the result of the work of many people who made the code better
- ddebree
- Tomas Liubinas
- Alex
+ - Patrick Dawkins
- Klaas Naaijkens
- Daniel González Cerviño
- - ShinDarth
- Rafał
- Adria Lopez (adlpz)
- Rosio (ben-rosio)
@@ -1338,9 +1354,9 @@ Symfony is the result of the work of many people who made the code better
- Michael Pohlers (mick_the_big)
- Cayetano Soriano Gallego (neoshadybeat)
- Ondrej Machulda (ondram)
- - Patrick McDougle (patrick-mcdougle)
- Pablo Monterde Perez (plebs)
- Jimmy Leger (redpanda)
+ - Marcin Szepczynski (szepczynski)
- Cyrille Jouineau (tuxosaurus)
- Yorkie Chadwick (yorkie76)
- Yanick Witschi
@@ -1363,6 +1379,7 @@ Symfony is the result of the work of many people who made the code better
- Arnaud Buathier (arnapou)
- chesteroni (chesteroni)
- Mauricio Lopez (diaspar)
+ - HADJEDJ Vincent (hadjedjvincent)
- Daniele Cesarini (ijanki)
- Ismail Asci (ismailasci)
- Simon CONSTANS (kosssi)
@@ -1505,7 +1522,6 @@ Symfony is the result of the work of many people who made the code better
- Damián Nohales (eagleoneraptor)
- Elliot Anderson (elliot)
- Fabien D. (fabd)
- - Fabien Bourigault (fbourigault)
- Carsten Eilers (fnc)
- Sorin Gitlan (forapathy)
- Yohan Giarelli (frequence-web)
@@ -1549,7 +1565,6 @@ Symfony is the result of the work of many people who made the code better
- Daniel Perez Pinazo (pitiflautico)
- Brayden Williams (redstar504)
- Rich Sage (richsage)
- - Ruud Kamphuis (ruudk)
- Bart Ruysseveldt (ruyss)
- Sascha Dens (saschadens)
- scourgen hung (scourgen)
diff --git a/LICENSE b/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index e1c2e3a7e666a..585350ef44a93 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,14 @@ please read the [Contributing Code][3] part of the documentation. If you're subm
a pull request, please follow the guidelines in the [Submitting a Patch][4] section
and use [Pull Request Template][5].
+Community Reviews
+-----------------
+
+If you don't feel ready to contribute code or patches, reviewing issues and pull
+requests can be a great start to get involved and give back. In fact, people who
+"triage" issues are the backbone to Symfony's success!
+More information can be found in the [Community Reviews][8] guide.
+
Running Symfony Tests
----------------------
@@ -54,3 +62,4 @@ Information on how to run the Symfony test suite can be found in the
[5]: https://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
[6]: https://symfony.com/doc/master/contributing/code/tests.html
[7]: https://symfony.com/doc/current/book/installation.html#installing-the-symfony-installer
+[8]: https://symfony.com/doc/current/contributing/community/reviews.html
diff --git a/appveyor.yml b/appveyor.yml
index f8162c0689ff0..5f3953ed8acca 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -3,7 +3,7 @@ clone_depth: 1
clone_folder: c:\projects\symfony
cache:
- - c:\projects\symfony\composer.phar
+ - composer.phar
- .phpunit -> phpunit
init:
@@ -48,13 +48,12 @@ install:
- echo curl.cainfo=c:\php\cacert.pem >> php.ini-max
- copy /Y php.ini-max php.ini
- cd c:\projects\symfony
- - IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.2.1/composer.phar)
+ - IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.3.0/composer.phar)
- php composer.phar self-update
- copy /Y .composer\* %APPDATA%\Composer\
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
- php composer.phar update --no-progress --ansi
- - SET COMPOSER_ROOT_VERSION=
- php phpunit install
test_script:
diff --git a/phpunit b/phpunit
index f9243bcbf9e79..1e79197e316d3 100755
--- a/phpunit
+++ b/phpunit
@@ -1,6 +1,8 @@
#!/usr/bin/env php
method('getDatabasePlatform')
->will($this->returnValue(new MySqlPlatform()));
- $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$registry
->expects($this->any())
->method('getConnectionNames')
@@ -152,7 +152,7 @@ private function createCollector($queries)
->method('getConnection')
->will($this->returnValue($connection));
- $logger = $this->getMock('Doctrine\DBAL\Logging\DebugStack');
+ $logger = $this->getMockBuilder('Doctrine\DBAL\Logging\DebugStack')->getMock();
$logger->queries = $queries;
$collector = new DoctrineDataCollector($registry);
diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php
index 53ad5a0e3a8a7..77d89088d2b1e 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/DataFixtures/ContainerAwareLoaderTest.php
@@ -18,7 +18,7 @@ class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testShouldSetContainerOnContainerAwareFixture()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$loader = new ContainerAwareLoader($container);
$fixture = new ContainerAwareFixture();
diff --git a/src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php b/src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php
index a473b3ace2fe5..e3d48a703062c 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/ExpressionLanguage/DoctrineParserCacheTest.php
@@ -17,7 +17,7 @@ class DoctrineParserCacheTest extends \PHPUnit_Framework_TestCase
{
public function testFetch()
{
- $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
+ $doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
$parserCache = new DoctrineParserCache($doctrineCacheMock);
$doctrineCacheMock->expects($this->once())
@@ -31,7 +31,7 @@ public function testFetch()
public function testFetchUnexisting()
{
- $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
+ $doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
$parserCache = new DoctrineParserCache($doctrineCacheMock);
$doctrineCacheMock
@@ -44,7 +44,7 @@ public function testFetchUnexisting()
public function testSave()
{
- $doctrineCacheMock = $this->getMock('Doctrine\Common\Cache\Cache');
+ $doctrineCacheMock = $this->getMockBuilder('Doctrine\Common\Cache\Cache')->getMock();
$parserCache = new DoctrineParserCache($doctrineCacheMock);
$expression = $this->getMockBuilder('Symfony\Component\ExpressionLanguage\ParsedExpression')
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php
index 4848d88818f8a..98583b3bb13b2 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/DoctrineChoiceLoaderTest.php
@@ -72,14 +72,14 @@ class DoctrineChoiceLoaderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- $this->factory = $this->getMock('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface');
- $this->om = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
- $this->repository = $this->getMock('Doctrine\Common\Persistence\ObjectRepository');
+ $this->factory = $this->getMockBuilder('Symfony\Component\Form\ChoiceList\Factory\ChoiceListFactoryInterface')->getMock();
+ $this->om = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
+ $this->repository = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectRepository')->getMock();
$this->class = 'stdClass';
$this->idReader = $this->getMockBuilder('Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader')
->disableOriginalConstructor()
->getMock();
- $this->objectLoader = $this->getMock('Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface');
+ $this->objectLoader = $this->getMockBuilder('Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface')->getMock();
$this->obj1 = (object) array('name' => 'A');
$this->obj2 = (object) array('name' => 'B');
$this->obj3 = (object) array('name' => 'C');
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php
index 0cb900f6d04c4..f6b96bb2005e0 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php
@@ -86,10 +86,10 @@ public function requiredProvider()
private function getGuesser(ClassMetadata $classMetadata)
{
- $em = $this->getMock('Doctrine\Common\Persistence\ObjectManager');
+ $em = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')->getMock();
$em->expects($this->once())->method('getClassMetaData')->with('TestEntity')->will($this->returnValue($classMetadata));
- $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$registry->expects($this->once())->method('getManagers')->will($this->returnValue(array($em)));
return new DoctrineOrmTypeGuesser($registry);
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
index 57df4195bcec4..16bf4e11ab9c0 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php
@@ -32,7 +32,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
protected function getExtensions()
{
- $manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$manager->expects($this->any())
->method('getManager')
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
index 5341e81f7b602..5a93de6addd7c 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
@@ -1300,7 +1300,7 @@ public function testPropertyOption()
protected function createRegistryMock($name, $em)
{
- $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$registry->expects($this->any())
->method('getManager')
->with($this->equalTo($name))
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
index 37a72b07b6b02..42f56b0ca83c3 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
@@ -20,7 +20,7 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
*/
public function testLog($sql, $params, $logParams)
{
- $logger = $this->getMock('Psr\\Log\\LoggerInterface');
+ $logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$dbalLogger = $this
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -52,7 +52,7 @@ public function getLogFixtures()
public function testLogNonUtf8()
{
- $logger = $this->getMock('Psr\\Log\\LoggerInterface');
+ $logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$dbalLogger = $this
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -75,7 +75,7 @@ public function testLogNonUtf8()
public function testLogNonUtf8Array()
{
- $logger = $this->getMock('Psr\\Log\\LoggerInterface');
+ $logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$dbalLogger = $this
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -106,7 +106,7 @@ public function testLogNonUtf8Array()
public function testLogLongString()
{
- $logger = $this->getMock('Psr\\Log\\LoggerInterface');
+ $logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$dbalLogger = $this
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
@@ -137,7 +137,7 @@ public function testLogLongString()
*/
public function testLogUTF8LongString()
{
- $logger = $this->getMock('Psr\\Log\\LoggerInterface');
+ $logger = $this->getMockBuilder('Psr\\Log\\LoggerInterface')->getMock();
$dbalLogger = $this
->getMockBuilder('Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger')
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php
index 3c52a7d506074..cdc553b2f05b9 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Security/User/EntityUserProviderTest.php
@@ -150,7 +150,7 @@ public function testSupportProxy()
private function getManager($em, $name = null)
{
- $manager = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $manager = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$manager->expects($this->any())
->method('getManager')
->with($this->equalTo($name))
diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
index 33e484320a56a..348b46ddaa75e 100644
--- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
+++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
@@ -63,7 +63,7 @@ protected function setUp()
protected function createRegistryMock(ObjectManager $em = null)
{
- $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $registry = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
$registry->expects($this->any())
->method('getManager')
->with($this->equalTo(self::EM_NAME))
@@ -92,7 +92,7 @@ protected function createEntityManagerMock($repositoryMock)
->will($this->returnValue($repositoryMock))
;
- $classMetadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata');
+ $classMetadata = $this->getMockBuilder('Doctrine\Common\Persistence\Mapping\ClassMetadata')->getMock();
$classMetadata
->expects($this->any())
->method('hasField')
diff --git a/src/Symfony/Bridge/Monolog/LICENSE b/src/Symfony/Bridge/Monolog/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bridge/Monolog/LICENSE
+++ b/src/Symfony/Bridge/Monolog/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php b/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
index 6cb315967e4fc..b8efa6fcf9591 100644
--- a/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
+++ b/src/Symfony/Bridge/Monolog/Tests/Handler/ConsoleHandlerTest.php
@@ -45,7 +45,7 @@ public function testIsHandling()
*/
public function testVerbosityMapping($verbosity, $level, $isHandling, array $map = array())
{
- $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock();
$output
->expects($this->atLeastOnce())
->method('getVerbosity')
@@ -80,7 +80,7 @@ public function provideVerbosityMappingTests()
public function testVerbosityChanged()
{
- $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock();
$output
->expects($this->at(0))
->method('getVerbosity')
@@ -110,7 +110,7 @@ public function testGetFormatter()
public function testWritingAndFormatting()
{
- $output = $this->getMock('Symfony\Component\Console\Output\OutputInterface');
+ $output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')->getMock();
$output
->expects($this->any())
->method('getVerbosity')
@@ -165,12 +165,12 @@ public function testLogsFromListeners()
$logger->addInfo('After terminate message.');
});
- $event = new ConsoleCommandEvent(new Command('foo'), $this->getMock('Symfony\Component\Console\Input\InputInterface'), $output);
+ $event = new ConsoleCommandEvent(new Command('foo'), $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock(), $output);
$dispatcher->dispatch(ConsoleEvents::COMMAND, $event);
$this->assertContains('Before command message.', $out = $output->fetch());
$this->assertContains('After command message.', $out);
- $event = new ConsoleTerminateEvent(new Command('foo'), $this->getMock('Symfony\Component\Console\Input\InputInterface'), $output, 0);
+ $event = new ConsoleTerminateEvent(new Command('foo'), $this->getMockBuilder('Symfony\Component\Console\Input\InputInterface')->getMock(), $output, 0);
$dispatcher->dispatch(ConsoleEvents::TERMINATE, $event);
$this->assertContains('Before terminate message.', $out = $output->fetch());
$this->assertContains('After terminate message.', $out);
diff --git a/src/Symfony/Bridge/PhpUnit/LICENSE b/src/Symfony/Bridge/PhpUnit/LICENSE
index 39fa189d2b5fc..207646a052dcd 100644
--- a/src/Symfony/Bridge/PhpUnit/LICENSE
+++ b/src/Symfony/Bridge/PhpUnit/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2016 Fabien Potencier
+Copyright (c) 2014-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/ProxyManager/LICENSE b/src/Symfony/Bridge/ProxyManager/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bridge/ProxyManager/LICENSE
+++ b/src/Symfony/Bridge/ProxyManager/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php
index 8b2402b045f28..12bef7b72dc08 100644
--- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php
+++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php
@@ -37,7 +37,7 @@ protected function setUp()
public function testInstantiateProxy()
{
$instance = new \stdClass();
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$definition = new Definition('stdClass');
$instantiator = function () use ($instance) {
return $instance;
diff --git a/src/Symfony/Bridge/Swiftmailer/LICENSE b/src/Symfony/Bridge/Swiftmailer/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bridge/Swiftmailer/LICENSE
+++ b/src/Symfony/Bridge/Swiftmailer/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Twig/LICENSE b/src/Symfony/Bridge/Twig/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bridge/Twig/LICENSE
+++ b/src/Symfony/Bridge/Twig/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php b/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php
index f9333bf683d1a..1284cf52a20b7 100644
--- a/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php
+++ b/src/Symfony/Bridge/Twig/NodeVisitor/Scope.php
@@ -42,7 +42,7 @@ public function __construct(Scope $parent = null)
/**
* Opens a new child scope.
*
- * @return Scope
+ * @return self
*/
public function enter()
{
@@ -52,7 +52,7 @@ public function enter()
/**
* Closes current scope and returns parent one.
*
- * @return Scope|null
+ * @return self|null
*/
public function leave()
{
@@ -67,7 +67,7 @@ public function leave()
* @param string $key
* @param mixed $value
*
- * @return Scope Current scope
+ * @return $this
*
* @throws \LogicException
*/
diff --git a/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php b/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php
index 51a95bc4b57e0..92ed4600bae1a 100644
--- a/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/AppVariableTest.php
@@ -45,7 +45,7 @@ public function testEnvironment()
public function testGetSession()
{
- $request = $this->getMock('Symfony\Component\HttpFoundation\Request');
+ $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock();
$request->method('getSession')->willReturn($session = new Session());
$this->setRequestStack($request);
@@ -69,7 +69,7 @@ public function testGetRequest()
public function testGetUser()
{
- $this->setTokenStorage($user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface'));
+ $this->setTokenStorage($user = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock());
$this->assertEquals($user, $this->appVariable->getUser());
}
@@ -83,7 +83,7 @@ public function testGetUserWithUsernameAsTokenUser()
public function testGetUserWithNoToken()
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
$this->appVariable->setTokenStorage($tokenStorage);
$this->assertNull($this->appVariable->getUser());
@@ -131,7 +131,7 @@ public function testGetSessionWithRequestStackNotSet()
protected function setRequestStack($request)
{
- $requestStackMock = $this->getMock('Symfony\Component\HttpFoundation\RequestStack');
+ $requestStackMock = $this->getMockBuilder('Symfony\Component\HttpFoundation\RequestStack')->getMock();
$requestStackMock->method('getCurrentRequest')->willReturn($request);
$this->appVariable->setRequestStack($requestStackMock);
@@ -139,10 +139,10 @@ protected function setRequestStack($request)
protected function setTokenStorage($user)
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
$this->appVariable->setTokenStorage($tokenStorage);
- $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
$tokenStorage->method('getToken')->willReturn($token);
$token->method('getUser')->willReturn($user);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php
index af93114e5ae57..0800ba8ea2608 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/DumpExtensionTest.php
@@ -63,7 +63,7 @@ public function getDumpTags()
public function testDump($context, $args, $expectedOutput, $debug = true)
{
$extension = new DumpExtension(new VarCloner());
- $twig = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array(
+ $twig = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array(
'debug' => $debug,
'cache' => false,
'optimizations' => 0,
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php
index c7195ab577820..2951e4471f731 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3HorizontalLayoutTest.php
@@ -39,7 +39,7 @@ protected function setUp()
'bootstrap_3_horizontal_layout.html.twig',
'custom_widgets.html.twig',
));
- $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface'));
+ $renderer = new TwigRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
$this->extension = new FormExtension($renderer);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
index 406c1cef16bf4..d26714530c954 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionBootstrap3LayoutTest.php
@@ -39,7 +39,7 @@ protected function setUp()
'bootstrap_3_layout.html.twig',
'custom_widgets.html.twig',
));
- $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface'));
+ $renderer = new TwigRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
$this->extension = new FormExtension($renderer);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
index 9e39ac35dc421..7e4c55e984b4a 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
@@ -40,7 +40,7 @@ protected function setUp()
'form_div_layout.html.twig',
'custom_widgets.html.twig',
));
- $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface'));
+ $renderer = new TwigRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
$this->extension = new FormExtension($renderer);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
index 7fa88eef00c7e..6509c405e7bc9 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionTableLayoutTest.php
@@ -39,7 +39,7 @@ protected function setUp()
'form_table_layout.html.twig',
'custom_widgets.html.twig',
));
- $renderer = new TwigRenderer($rendererEngine, $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface'));
+ $renderer = new TwigRenderer($rendererEngine, $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock());
$this->extension = new FormExtension($renderer);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php
index 48bebdc13f8f5..8101a7d59b0b6 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php
@@ -51,7 +51,7 @@ public function testUnknownFragmentRenderer()
protected function getFragmentHandler($return)
{
- $strategy = $this->getMock('Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface');
+ $strategy = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Fragment\\FragmentRendererInterface')->getMock();
$strategy->expects($this->once())->method('getName')->will($this->returnValue('inline'));
$strategy->expects($this->once())->method('render')->will($return);
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php
index 9733cd7b8ace6..9f06b50ba0514 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/RoutingExtensionTest.php
@@ -20,8 +20,8 @@ class RoutingExtensionTest extends \PHPUnit_Framework_TestCase
*/
public function testEscaping($template, $mustBeEscaped)
{
- $twig = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0));
- $twig->addExtension(new RoutingExtension($this->getMock('Symfony\Component\Routing\Generator\UrlGeneratorInterface')));
+ $twig = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0));
+ $twig->addExtension(new RoutingExtension($this->getMockBuilder('Symfony\Component\Routing\Generator\UrlGeneratorInterface')->getMock()));
$nodes = $twig->parse($twig->tokenize(new \Twig_Source($template, '')));
diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php
index 8c0cdfe69b620..2ea111b0baacd 100644
--- a/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Extension/StopwatchExtensionTest.php
@@ -53,7 +53,7 @@ public function getTimingTemplates()
protected function getStopwatch($events = array())
{
$events = is_array($events) ? $events : array($events);
- $stopwatch = $this->getMock('Symfony\Component\Stopwatch\Stopwatch');
+ $stopwatch = $this->getMockBuilder('Symfony\Component\Stopwatch\Stopwatch')->getMock();
$i = -1;
foreach ($events as $eventName) {
diff --git a/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php
index 035dc4f671431..8d3ede471c506 100644
--- a/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Node/DumpNodeTest.php
@@ -19,7 +19,7 @@ public function testNoVar()
{
$node = new DumpNode('bar', null, 7);
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
$compiler = new \Twig_Compiler($env);
$expected = <<<'EOTXT'
@@ -43,7 +43,7 @@ public function testIndented()
{
$node = new DumpNode('bar', null, 7);
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
$compiler = new \Twig_Compiler($env);
$expected = <<<'EOTXT'
@@ -70,7 +70,7 @@ public function testOneVar()
));
$node = new DumpNode('bar', $vars, 7);
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
$compiler = new \Twig_Compiler($env);
$expected = <<<'EOTXT'
@@ -99,7 +99,7 @@ public function testMultiVars()
));
$node = new DumpNode('bar', $vars, 7);
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
$compiler = new \Twig_Compiler($env);
$expected = <<<'EOTXT'
diff --git a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php
index 590b9ef75c617..02732f1932e82 100644
--- a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php
@@ -41,7 +41,7 @@ public function testCompile()
$node = new FormThemeNode($form, $resources, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
diff --git a/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php
index 0a3d30bdd5e5e..408b7cfd145d5 100644
--- a/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php
@@ -23,7 +23,7 @@ public function testCompileWidget()
$node = new SearchAndRenderBlockNode('form_widget', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
@@ -46,7 +46,7 @@ public function testCompileWidgetWithVariables()
$node = new SearchAndRenderBlockNode('form_widget', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
@@ -66,7 +66,7 @@ public function testCompileLabelWithLabel()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
@@ -86,7 +86,7 @@ public function testCompileLabelWithNullLabel()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
// "label" => null must not be included in the output!
// Otherwise the default label is overwritten with null.
@@ -108,7 +108,7 @@ public function testCompileLabelWithEmptyStringLabel()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
// "label" => null must not be included in the output!
// Otherwise the default label is overwritten with null.
@@ -129,7 +129,7 @@ public function testCompileLabelWithDefaultLabel()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
@@ -153,7 +153,7 @@ public function testCompileLabelWithAttributes()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
// "label" => null must not be included in the output!
// Otherwise the default label is overwritten with null.
@@ -182,7 +182,7 @@ public function testCompileLabelWithLabelAndAttributes()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
$this->assertEquals(
sprintf(
@@ -210,7 +210,7 @@ public function testCompileLabelWithLabelThatEvaluatesToNull()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
// "label" => null must not be included in the output!
// Otherwise the default label is overwritten with null.
@@ -247,7 +247,7 @@ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
$node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
- $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMock('Twig_LoaderInterface')));
+ $compiler = new \Twig_Compiler(new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock()));
// "label" => null must not be included in the output!
// Otherwise the default label is overwritten with null.
diff --git a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php
index cbd21fc46edd2..b1980b8a37722 100644
--- a/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php
@@ -24,7 +24,7 @@ public function testCompileStrict()
$vars = new \Twig_Node_Expression_Name('foo', 0);
$node = new TransNode($body, null, null, $vars);
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('strict_variables' => true));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('strict_variables' => true));
$compiler = new \Twig_Compiler($env);
$this->assertEquals(
@@ -53,7 +53,7 @@ protected function getVariableGetterWithoutStrictCheck($name)
protected function getVariableGetterWithStrictCheck($name)
{
if (\Twig_Environment::MAJOR_VERSION >= 2) {
- return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : $this->notFound("%s", 0))', $name, $name, $name, $name);
+ return sprintf('(isset($context["%s"]) || array_key_exists("%s", $context) ? $context["%s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%s" does not exist.\', 0, $this->getSourceContext()); })())', $name, $name, $name, $name);
}
if (PHP_VERSION_ID >= 70000) {
diff --git a/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php b/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php
index f9cf08bc28017..86dc25266c72d 100644
--- a/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationDefaultDomainNodeVisitorTest.php
@@ -22,7 +22,7 @@ class TranslationDefaultDomainNodeVisitorTest extends \PHPUnit_Framework_TestCas
/** @dataProvider getDefaultDomainAssignmentTestData */
public function testDefaultDomainAssignment(\Twig_Node $node)
{
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
$visitor = new TranslationDefaultDomainNodeVisitor();
// visit trans_default_domain tag
@@ -48,7 +48,7 @@ public function testDefaultDomainAssignment(\Twig_Node $node)
/** @dataProvider getDefaultDomainAssignmentTestData */
public function testNewModuleWithoutDefaultDomainTag(\Twig_Node $node)
{
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
$visitor = new TranslationDefaultDomainNodeVisitor();
// visit trans_default_domain tag
diff --git a/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php b/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php
index 16736031e087d..571b5bba31745 100644
--- a/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/NodeVisitor/TranslationNodeVisitorTest.php
@@ -18,7 +18,7 @@ class TranslationNodeVisitorTest extends \PHPUnit_Framework_TestCase
/** @dataProvider getMessagesExtractionTestData */
public function testMessagesExtraction(\Twig_Node $node, array $expectedMessages)
{
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
$visitor = new TranslationNodeVisitor();
$visitor->enable();
$visitor->enterNode($node, $env);
diff --git a/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php b/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php
index 6b6a92abf1434..6dea9fd693702 100644
--- a/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php
@@ -21,7 +21,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
*/
public function testCompile($source, $expected)
{
- $env = new \Twig_Environment($this->getMock('Twig_LoaderInterface'), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
+ $env = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock(), array('cache' => false, 'autoescape' => false, 'optimizations' => 0));
$env->addTokenParser(new FormThemeTokenParser());
$stream = $env->tokenize(new \Twig_Source($source, ''));
$parser = new \Twig_Parser($env);
diff --git a/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php b/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php
index 23869da436d68..4362e9131acb6 100644
--- a/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/Translation/TwigExtractorTest.php
@@ -22,14 +22,14 @@ class TwigExtractorTest extends \PHPUnit_Framework_TestCase
*/
public function testExtract($template, $messages)
{
- $loader = $this->getMock('Twig_LoaderInterface');
+ $loader = $this->getMockBuilder('Twig_LoaderInterface')->getMock();
$twig = new \Twig_Environment($loader, array(
'strict_variables' => true,
'debug' => true,
'cache' => false,
'autoescape' => false,
));
- $twig->addExtension(new TranslationExtension($this->getMock('Symfony\Component\Translation\TranslatorInterface')));
+ $twig->addExtension(new TranslationExtension($this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock()));
$extractor = new TwigExtractor($twig);
$extractor->setPrefix('prefix');
@@ -77,8 +77,8 @@ public function getExtractData()
*/
public function testExtractSyntaxError($resources)
{
- $twig = new \Twig_Environment($this->getMock('Twig_LoaderInterface'));
- $twig->addExtension(new TranslationExtension($this->getMock('Symfony\Component\Translation\TranslatorInterface')));
+ $twig = new \Twig_Environment($this->getMockBuilder('Twig_LoaderInterface')->getMock());
+ $twig->addExtension(new TranslationExtension($this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock()));
$extractor = new TwigExtractor($twig);
@@ -120,7 +120,7 @@ public function testExtractWithFiles($resource)
'cache' => false,
'autoescape' => false,
));
- $twig->addExtension(new TranslationExtension($this->getMock('Symfony\Component\Translation\TranslatorInterface')));
+ $twig->addExtension(new TranslationExtension($this->getMockBuilder('Symfony\Component\Translation\TranslatorInterface')->getMock()));
$extractor = new TwigExtractor($twig);
$catalogue = new MessageCatalogue('en');
diff --git a/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php b/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php
index e7047c354d080..b3eebb55c9871 100644
--- a/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php
+++ b/src/Symfony/Bridge/Twig/Tests/TwigEngineTest.php
@@ -71,7 +71,7 @@ protected function getTwig()
'index' => 'foo',
'error' => '{{ foo }',
)));
- $parser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface');
+ $parser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock();
return new TwigEngine($twig, $parser);
}
diff --git a/src/Symfony/Bridge/Twig/composer.json b/src/Symfony/Bridge/Twig/composer.json
index 74c98e93a50e8..426bf9a64caea 100644
--- a/src/Symfony/Bridge/Twig/composer.json
+++ b/src/Symfony/Bridge/Twig/composer.json
@@ -22,7 +22,7 @@
"require-dev": {
"symfony/asset": "~2.7",
"symfony/finder": "~2.3",
- "symfony/form": "~2.7.11|~2.8.4",
+ "symfony/form": "~2.7.23|~2.8.16",
"symfony/http-kernel": "~2.3",
"symfony/intl": "~2.3",
"symfony/routing": "~2.2",
diff --git a/src/Symfony/Bundle/DebugBundle/LICENSE b/src/Symfony/Bundle/DebugBundle/LICENSE
index 39fa189d2b5fc..207646a052dcd 100644
--- a/src/Symfony/Bundle/DebugBundle/LICENSE
+++ b/src/Symfony/Bundle/DebugBundle/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2016 Fabien Potencier
+Copyright (c) 2014-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php
index acf71c666605a..3e1c324f00203 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerCommand.php
@@ -54,7 +54,9 @@ protected function isOtherServerProcessRunning($address)
return true;
}
- list($hostname, $port) = explode(':', $address);
+ $pos = strrpos($address, ':');
+ $hostname = substr($address, 0, $pos);
+ $port = substr($address, $pos + 1);
$fp = @fsockopen($hostname, $port, $errno, $errstr, 5);
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
index 278b8b9b7d672..b6b7a450e08ff 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
@@ -692,12 +692,11 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
$dirs[] = dirname(dirname($r->getFileName())).'/Resources/translations';
}
$rootDir = $container->getParameter('kernel.root_dir');
- foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
- $reflection = new \ReflectionClass($class);
- if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/translations')) {
+ foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
+ if (is_dir($dir = $bundle['path'].'/Resources/translations')) {
$dirs[] = $dir;
}
- if (is_dir($dir = $rootDir.sprintf('/Resources/%s/translations', $bundle))) {
+ if (is_dir($dir = $rootDir.sprintf('/Resources/%s/translations', $name))) {
$dirs[] = $dir;
}
}
@@ -751,6 +750,10 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
return;
}
+ if (!class_exists('Symfony\Component\Validator\Validation')) {
+ throw new LogicException('Validation support cannot be enabled as the Validator component is not installed.');
+ }
+
$loader->load('validator.xml');
$validatorBuilder = $container->getDefinition('validator.builder');
@@ -805,11 +808,8 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
$container->addResource(new FileResource($files[0][0]));
}
- $bundles = $container->getParameter('kernel.bundles');
- foreach ($bundles as $bundle) {
- $reflection = new \ReflectionClass($bundle);
- $dirname = dirname($reflection->getFileName());
-
+ foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) {
+ $dirname = $bundle['path'];
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
$files[0][] = $file;
$container->addResource(new FileResource($file));
@@ -920,10 +920,8 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
$serializerLoaders[] = $annotationLoader;
}
- $bundles = $container->getParameter('kernel.bundles');
- foreach ($bundles as $bundle) {
- $reflection = new \ReflectionClass($bundle);
- $dirname = dirname($reflection->getFileName());
+ foreach ($container->getParameter('kernel.bundles_metadata') as $bundle) {
+ $dirname = $bundle['path'];
if (is_file($file = $dirname.'/Resources/config/serialization.xml')) {
$definition = new Definition('Symfony\Component\Serializer\Mapping\Loader\XmlFileLoader', array($file));
diff --git a/src/Symfony/Bundle/FrameworkBundle/LICENSE b/src/Symfony/Bundle/FrameworkBundle/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bundle/FrameworkBundle/LICENSE
+++ b/src/Symfony/Bundle/FrameworkBundle/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
index ac1077a205ae3..4ffa2e84ff24c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/button_attributes.html.php
@@ -1,6 +1,6 @@
id="escape($id) ?>" name="escape($full_name) ?>" disabled="disabled"
$v): ?>
-
+
escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
escape($k), $view->escape($k)) ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
index 327925a537196..7aa9e9d406d02 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_container_attributes.html.php
@@ -1,6 +1,6 @@
id="escape($id) ?>"
$v): ?>
-
+
escape($k), $view->escape($view['translator']->trans($v, array(), $translation_domain))) ?>
escape($k), $view->escape($k)) ?>
diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php
index 286b7c62e4d2a..369e95a1f08aa 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php
@@ -24,6 +24,8 @@ class TemplateLocator implements FileLocatorInterface
protected $locator;
protected $cache;
+ private $cacheHits = array();
+
/**
* Constructor.
*
@@ -71,12 +73,15 @@ public function locate($template, $currentPath = null, $first = true)
$key = $this->getCacheKey($template);
+ if (isset($this->cacheHits[$key])) {
+ return $this->cacheHits[$key];
+ }
if (isset($this->cache[$key])) {
- return $this->cache[$key];
+ return $this->cacheHits[$key] = realpath($this->cache[$key]) ?: $this->cache[$key];
}
try {
- return $this->cache[$key] = $this->locator->locate($template->getPath(), $currentPath);
+ return $this->cacheHits[$key] = $this->locator->locate($template->getPath(), $currentPath);
} catch (\InvalidArgumentException $e) {
throw new \InvalidArgumentException(sprintf('Unable to find template "%s" : "%s".', $template, $e->getMessage()), 0, $e);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
index 25d9a72b961a9..aac62095b1a14 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterDebugCommandTest.php
@@ -63,7 +63,7 @@ private function getContainer()
{
$routeCollection = new RouteCollection();
$routeCollection->add('foo', new Route('foo'));
- $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $router = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
$router
->expects($this->any())
->method('getRouteCollection')
@@ -74,7 +74,7 @@ private function getContainer()
->disableOriginalConstructor()
->getMock();
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
->method('has')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php
index fc7e2155537fe..cb7f698bc664e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php
@@ -62,7 +62,7 @@ private function getContainer()
$routeCollection = new RouteCollection();
$routeCollection->add('foo', new Route('foo'));
$requestContext = new RequestContext();
- $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $router = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
$router
->expects($this->any())
->method('getRouteCollection')
@@ -78,7 +78,7 @@ private function getContainer()
->disableOriginalConstructor()
->getMock();
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
->method('has')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
index 27f61c4383f24..60f81565d36de 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php
@@ -64,7 +64,7 @@ public function testDebugDefaultDirectory()
public function testDebugCustomDirectory()
{
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel->expects($this->once())
->method('getBundle')
->with($this->equalTo($this->translationDir))
@@ -82,7 +82,7 @@ public function testDebugCustomDirectory()
*/
public function testDebugInvalidDirectory()
{
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel->expects($this->once())
->method('getBundle')
->with($this->equalTo('dir'))
@@ -130,7 +130,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
->method('getFallbackLocales')
->will($this->returnValue(array('en')));
- $extractor = $this->getMock('Symfony\Component\Translation\Extractor\ExtractorInterface');
+ $extractor = $this->getMockBuilder('Symfony\Component\Translation\Extractor\ExtractorInterface')->getMock();
$extractor
->expects($this->any())
->method('extract')
@@ -140,7 +140,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
})
);
- $loader = $this->getMock('Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader');
+ $loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader')->getMock();
$loader
->expects($this->any())
->method('loadMessages')
@@ -151,7 +151,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
);
if (null === $kernel) {
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
->expects($this->any())
->method('getBundle')
@@ -166,7 +166,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
->method('getRootDir')
->will($this->returnValue($this->translationDir));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->any())
->method('get')
@@ -182,7 +182,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
private function getBundle($path)
{
- $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface');
+ $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface')->getMock();
$bundle
->expects($this->any())
->method('getPath')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
index 24a4f625f6db5..8690263374e7b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php
@@ -68,7 +68,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
->method('getFallbackLocales')
->will($this->returnValue(array('en')));
- $extractor = $this->getMock('Symfony\Component\Translation\Extractor\ExtractorInterface');
+ $extractor = $this->getMockBuilder('Symfony\Component\Translation\Extractor\ExtractorInterface')->getMock();
$extractor
->expects($this->any())
->method('extract')
@@ -78,7 +78,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
})
);
- $loader = $this->getMock('Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader');
+ $loader = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader')->getMock();
$loader
->expects($this->any())
->method('loadMessages')
@@ -88,7 +88,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
})
);
- $writer = $this->getMock('Symfony\Component\Translation\Writer\TranslationWriter');
+ $writer = $this->getMockBuilder('Symfony\Component\Translation\Writer\TranslationWriter')->getMock();
$writer
->expects($this->any())
->method('getFormats')
@@ -97,7 +97,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
);
if (null === $kernel) {
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
->expects($this->any())
->method('getBundle')
@@ -112,7 +112,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
->method('getRootDir')
->will($this->returnValue($this->translationDir));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->any())
->method('get')
@@ -129,7 +129,7 @@ private function getContainer($extractedMessages = array(), $loadedMessages = ar
private function getBundle($path)
{
- $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface');
+ $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface')->getMock();
$bundle
->expects($this->any())
->method('getPath')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
index a944da863f6d0..fc60fd3bdd71c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/ApplicationTest.php
@@ -22,7 +22,7 @@ class ApplicationTest extends TestCase
{
public function testBundleInterfaceImplementation()
{
- $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface');
+ $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface')->getMock();
$kernel = $this->getKernel(array($bundle), true);
@@ -117,10 +117,10 @@ public function testBundleCommandsHaveRightContainer()
private function getKernel(array $bundles, $useDispatcher = false)
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
if ($useDispatcher) {
- $dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+ $dispatcher = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcherInterface')->getMock();
$dispatcher
->expects($this->atLeastOnce())
->method('dispatch')
@@ -145,7 +145,7 @@ private function getKernel(array $bundles, $useDispatcher = false)
->will($this->returnValue(array()))
;
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
->expects($this->any())
->method('getBundles')
@@ -162,7 +162,7 @@ private function getKernel(array $bundles, $useDispatcher = false)
private function createBundleMock(array $commands)
{
- $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\Bundle');
+ $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\Bundle')->getMock();
$bundle
->expects($this->once())
->method('registerCommands')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php
index 894e7ae3285d3..2fe271663e2d3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerNameParserTest.php
@@ -147,7 +147,7 @@ private function createParser()
'FabpotFooBundle' => array($this->getBundle('TestBundle\Fabpot\FooBundle', 'FabpotFooBundle'), $this->getBundle('TestBundle\Sensio\FooBundle', 'SensioFooBundle')),
);
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
->expects($this->any())
->method('getBundle')
@@ -178,7 +178,7 @@ private function createParser()
private function getBundle($namespace, $name)
{
- $bundle = $this->getMock('Symfony\Component\HttpKernel\Bundle\BundleInterface');
+ $bundle = $this->getMockBuilder('Symfony\Component\HttpKernel\Bundle\BundleInterface')->getMock();
$bundle->expects($this->any())->method('getName')->will($this->returnValue($name));
$bundle->expects($this->any())->method('getNamespace')->will($this->returnValue($namespace));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php
index 00ffa4c1fd162..36e8ed90a7117 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerResolverTest.php
@@ -175,12 +175,12 @@ protected function createControllerResolver(LoggerInterface $logger = null, Cont
protected function createMockParser()
{
- return $this->getMock('Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser', array(), array(), '', false);
+ return $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser')->disableOriginalConstructor()->getMock();
}
protected function createMockContainer()
{
- return $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ return $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php
index 307770316c6e6..d7f40a24d8b4a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/ControllerTest.php
@@ -33,12 +33,12 @@ public function testForward()
$requestStack = new RequestStack();
$requestStack->push($request);
- $kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\HttpKernelInterface')->getMock();
$kernel->expects($this->once())->method('handle')->will($this->returnCallback(function (Request $request) {
return new Response($request->getRequestFormat().'--'.$request->getLocale());
}));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($requestStack));
$container->expects($this->at(1))->method('get')->will($this->returnValue($kernel));
@@ -84,7 +84,7 @@ public function testGetUserWithEmptyTokenStorage()
*/
public function testGetUserWithEmptyContainer()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
->method('has')
@@ -104,13 +104,13 @@ public function testGetUserWithEmptyContainer()
*/
private function getContainerWithTokenStorage($token = null)
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage')->getMock();
$tokenStorage
->expects($this->once())
->method('getToken')
->will($this->returnValue($token));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
->method('has')
@@ -128,10 +128,10 @@ private function getContainerWithTokenStorage($token = null)
public function testRedirectToRoute()
{
- $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $router = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
$router->expects($this->once())->method('generate')->willReturn('/foo');
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($router));
$controller = new TestController();
@@ -146,10 +146,10 @@ public function testRedirectToRoute()
public function testAddFlash()
{
$flashBag = new FlashBag();
- $session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session');
+ $session = $this->getMockBuilder('Symfony\Component\HttpFoundation\Session\Session')->getMock();
$session->expects($this->once())->method('getFlashBag')->willReturn($flashBag);
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('has')->will($this->returnValue(true));
$container->expects($this->at(1))->method('get')->will($this->returnValue($session));
@@ -169,10 +169,10 @@ public function testCreateAccessDeniedException()
public function testIsCsrfTokenValid()
{
- $tokenManager = $this->getMock('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface');
+ $tokenManager = $this->getMockBuilder('Symfony\Component\Security\Csrf\CsrfTokenManagerInterface')->getMock();
$tokenManager->expects($this->once())->method('isTokenValid')->willReturn(true);
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('has')->will($this->returnValue(true));
$container->expects($this->at(1))->method('get')->will($this->returnValue($tokenManager));
@@ -184,10 +184,10 @@ public function testIsCsrfTokenValid()
public function testGenerateUrl()
{
- $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $router = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
$router->expects($this->once())->method('generate')->willReturn('/foo');
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($router));
$controller = new Controller();
@@ -208,10 +208,10 @@ public function testRedirect()
public function testRenderViewTemplating()
{
- $templating = $this->getMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
+ $templating = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
$templating->expects($this->once())->method('render')->willReturn('bar');
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($templating));
$controller = new Controller();
@@ -222,10 +222,10 @@ public function testRenderViewTemplating()
public function testRenderTemplating()
{
- $templating = $this->getMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
+ $templating = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
$templating->expects($this->once())->method('renderResponse')->willReturn(new Response('bar'));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($templating));
$controller = new Controller();
@@ -236,9 +236,9 @@ public function testRenderTemplating()
public function testStreamTemplating()
{
- $templating = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $templating = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($templating));
$controller = new Controller();
@@ -256,12 +256,12 @@ public function testCreateNotFoundException()
public function testCreateForm()
{
- $form = $this->getMock('Symfony\Component\Form\FormInterface');
+ $form = $this->getMockBuilder('Symfony\Component\Form\FormInterface')->getMock();
- $formFactory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
+ $formFactory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
$formFactory->expects($this->once())->method('create')->willReturn($form);
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($formFactory));
$controller = new Controller();
@@ -272,12 +272,12 @@ public function testCreateForm()
public function testCreateFormBuilder()
{
- $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface');
+ $formBuilder = $this->getMockBuilder('Symfony\Component\Form\FormBuilderInterface')->getMock();
- $formFactory = $this->getMock('Symfony\Component\Form\FormFactoryInterface');
+ $formFactory = $this->getMockBuilder('Symfony\Component\Form\FormFactoryInterface')->getMock();
$formFactory->expects($this->once())->method('createBuilder')->willReturn($formBuilder);
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('get')->will($this->returnValue($formFactory));
$controller = new Controller();
@@ -288,9 +288,9 @@ public function testCreateFormBuilder()
public function testGetDoctrine()
{
- $doctrine = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
+ $doctrine = $this->getMockBuilder('Doctrine\Common\Persistence\ManagerRegistry')->getMock();
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->at(0))->method('has')->will($this->returnValue(true));
$container->expects($this->at(1))->method('get')->will($this->returnValue($doctrine));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php
index eaca189330599..14b6e4428e550 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php
@@ -66,14 +66,14 @@ public function testRoute($permanent, $ignoreAttributes, $expectedCode, $expecte
$request->attributes = new ParameterBag($attributes);
- $router = $this->getMock('Symfony\Component\Routing\RouterInterface');
+ $router = $this->getMockBuilder('Symfony\Component\Routing\RouterInterface')->getMock();
$router
->expects($this->once())
->method('generate')
->with($this->equalTo($route), $this->equalTo($expectedAttributes))
->will($this->returnValue($url));
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
@@ -230,7 +230,7 @@ public function testPathQueryParams($expectedUrl, $path, $queryString)
private function createRequestObject($scheme, $host, $port, $baseUrl, $queryString = '')
{
- $request = $this->getMock('Symfony\Component\HttpFoundation\Request');
+ $request = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')->getMock();
$request
->expects($this->any())
->method('getScheme')
@@ -257,7 +257,7 @@ private function createRequestObject($scheme, $host, $port, $baseUrl, $queryStri
private function createRedirectController($httpPort = null, $httpsPort = null)
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
if (null !== $httpPort) {
$container
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php
index 61d31cb86b7b6..7ee9aa558e5f6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php
@@ -24,11 +24,8 @@ public function testThatCacheWarmersAreProcessedInPriorityOrder()
'my_cache_warmer_service3' => array(),
);
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('findTaggedServiceIds', 'getDefinition', 'hasDefinition')
- );
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds', 'getDefinition', 'hasDefinition'))->getMock();
$container->expects($this->atLeastOnce())
->method('findTaggedServiceIds')
@@ -56,11 +53,8 @@ public function testThatCacheWarmersAreProcessedInPriorityOrder()
public function testThatCompilerPassIsIgnoredIfThereIsNoCacheWarmerDefinition()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$container->expects($this->never())->method('findTaggedServiceIds');
$container->expects($this->never())->method('getDefinition');
@@ -76,11 +70,8 @@ public function testThatCompilerPassIsIgnoredIfThereIsNoCacheWarmerDefinition()
public function testThatCacheWarmersMightBeNotDefined()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$container->expects($this->atLeastOnce())
->method('findTaggedServiceIds')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php
index 0629d1ebafd1f..88901dda70bd2 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddConstraintValidatorsPassTest.php
@@ -20,14 +20,11 @@ public function testThatConstraintValidatorServicesAreProcessed()
'my_constraint_validator_service2' => array(),
);
- $validatorFactoryDefinition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('findTaggedServiceIds', 'getDefinition', 'hasDefinition')
- );
+ $validatorFactoryDefinition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds', 'getDefinition', 'hasDefinition'))->getMock();
- $validatorDefinition1 = $this->getMock('Symfony\Component\DependencyInjection\Definition', array('getClass'));
- $validatorDefinition2 = $this->getMock('Symfony\Component\DependencyInjection\Definition', array('getClass'));
+ $validatorDefinition1 = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->setMethods(array('getClass'))->getMock();
+ $validatorDefinition2 = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->setMethods(array('getClass'))->getMock();
$validatorDefinition1->expects($this->atLeastOnce())
->method('getClass')
@@ -67,11 +64,8 @@ public function testThatConstraintValidatorServicesAreProcessed()
public function testThatCompilerPassIsIgnoredIfThereIsNoConstraintValidatorFactoryDefinition()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$container->expects($this->never())->method('findTaggedServiceIds');
$container->expects($this->never())->method('getDefinition');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LegacyFragmentRendererPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LegacyFragmentRendererPassTest.php
index 97c98d5d8f1ab..e5c6adba8c974 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LegacyFragmentRendererPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LegacyFragmentRendererPassTest.php
@@ -33,15 +33,12 @@ public function testContentRendererWithoutInterface()
'my_content_renderer' => array(),
);
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
$definition->expects($this->atLeastOnce())
->method('getClass')
->will($this->returnValue('stdClass'));
- $builder = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$builder->expects($this->any())
->method('hasDefinition')
->will($this->returnValue(true));
@@ -65,22 +62,19 @@ public function testValidContentRenderer()
'my_content_renderer' => array(),
);
- $renderer = $this->getMock('Symfony\Component\DependencyInjection\Definition');
+ $renderer = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
$renderer
->expects($this->once())
->method('addMethodCall')
->with('addRenderer', array(new Reference('my_content_renderer')))
;
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
$definition->expects($this->atLeastOnce())
->method('getClass')
->will($this->returnValue('Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler\RendererService'));
- $builder = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $builder = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$builder->expects($this->any())
->method('hasDefinition')
->will($this->returnValue(true));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php
index ad0d65390d2f9..b71fe0a80766d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/LoggingTranslatorPassTest.php
@@ -17,9 +17,9 @@ class LoggingTranslatorPassTest extends \PHPUnit_Framework_TestCase
{
public function testProcess()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
- $parameterBag = $this->getMock('Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface');
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock();
+ $parameterBag = $this->getMockBuilder('Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface')->getMock();
$container->expects($this->exactly(2))
->method('hasAlias')
@@ -60,7 +60,7 @@ public function testProcess()
public function testThatCompilerPassIsIgnoredIfThereIsNotLoggerDefinition()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock();
$container->expects($this->once())
->method('hasAlias')
->will($this->returnValue(false));
@@ -71,7 +71,7 @@ public function testThatCompilerPassIsIgnoredIfThereIsNotLoggerDefinition()
public function testThatCompilerPassIsIgnoredIfThereIsNotTranslatorDefinition()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->getMock();
$container->expects($this->at(0))
->method('hasAlias')
->will($this->returnValue(true));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php
index f2af872e3c1f9..9edb44ebb6e1c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/ProfilerPassTest.php
@@ -75,10 +75,7 @@ public function testValidCollector()
private function createContainerMock($services)
{
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'getDefinition', 'findTaggedServiceIds', 'setParameter')
- );
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'getDefinition', 'findTaggedServiceIds', 'setParameter'))->getMock();
$container->expects($this->any())
->method('hasDefinition')
->with($this->equalTo('profiler'))
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php
index a098c4fd626ac..3e592916a0a2a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php
@@ -23,7 +23,7 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase
{
public function testThrowExceptionWhenNoNormalizers()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('hasDefinition', 'findTaggedServiceIds'));
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds'))->getMock();
$container->expects($this->once())
->method('hasDefinition')
@@ -43,11 +43,8 @@ public function testThrowExceptionWhenNoNormalizers()
public function testThrowExceptionWhenNoEncoders()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'findTaggedServiceIds', 'getDefinition')
- );
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'findTaggedServiceIds', 'getDefinition'))->getMock();
$container->expects($this->once())
->method('hasDefinition')
@@ -85,7 +82,7 @@ public function testServicesAreOrderedAccordingToPriority()
new Reference('n3'),
);
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder', array('findTaggedServiceIds'));
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('findTaggedServiceIds'))->getMock();
$container->expects($this->atLeastOnce())
->method('findTaggedServiceIds')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php
index 83f70514d5456..dcdb0bc5bd377 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php
@@ -18,7 +18,7 @@ class TranslatorPassTest extends \PHPUnit_Framework_TestCase
{
public function testValidCollector()
{
- $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition');
+ $definition = $this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock();
$definition->expects($this->at(0))
->method('addMethodCall')
->with('addLoader', array('xliff', new Reference('xliff')));
@@ -26,10 +26,7 @@ public function testValidCollector()
->method('addMethodCall')
->with('addLoader', array('xlf', new Reference('xliff')));
- $container = $this->getMock(
- 'Symfony\Component\DependencyInjection\ContainerBuilder',
- array('hasDefinition', 'getDefinition', 'findTaggedServiceIds', 'findDefinition')
- );
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerBuilder')->setMethods(array('hasDefinition', 'getDefinition', 'findTaggedServiceIds', 'findDefinition'))->getMock();
$container->expects($this->any())
->method('hasDefinition')
->will($this->returnValue(true));
@@ -41,7 +38,7 @@ public function testValidCollector()
->will($this->returnValue(array('xliff' => array(array('alias' => 'xliff', 'legacy-alias' => 'xlf')))));
$container->expects($this->once())
->method('findDefinition')
- ->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition')));
+ ->will($this->returnValue($this->getMockBuilder('Symfony\Component\DependencyInjection\Definition')->getMock()));
$pass = new TranslatorPass();
$pass->process($container);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/Resources/config/validation.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/Resources/config/validation.xml
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/Resources/config/validation.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/Resources/config/validation.yml
new file mode 100644
index 0000000000000..e69de29bb2d1d
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/src/CustomPathBundle.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/src/CustomPathBundle.php
new file mode 100644
index 0000000000000..31cec239d894f
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/src/CustomPathBundle.php
@@ -0,0 +1,20 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bundle\FrameworkBundle\Tests;
+
+class CustomPathBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
+{
+ public function getPath()
+ {
+ return __DIR__.'/..';
+ }
+}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 922d6f95738f6..b9116d39a3602 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -342,7 +342,8 @@ public function testValidationPaths()
require_once __DIR__.'/Fixtures/TestBundle/TestBundle.php';
$container = $this->createContainerFromFile('validation_annotations', array(
- 'kernel.bundles' => array('TestBundle' => 'Symfony\Bundle\FrameworkBundle\Tests\TestBundle'),
+ 'kernel.bundles' => array('TestBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\TestBundle'),
+ 'kernel.bundles_metadata' => array('TestBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/TestBundle')),
));
$calls = $container->getDefinition('validator.builder')->getMethodCalls();
@@ -370,6 +371,33 @@ public function testValidationPaths()
$this->assertStringEndsWith('TestBundle/Resources/config/validation.yml', $yamlMappings[0]);
}
+ public function testValidationPathsUsingCustomBundlePath()
+ {
+ require_once __DIR__.'/Fixtures/CustomPathBundle/src/CustomPathBundle.php';
+
+ $container = $this->createContainerFromFile('validation_annotations', array(
+ 'kernel.bundles' => array('CustomPathBundle' => 'Symfony\\Bundle\\FrameworkBundle\\Tests\\CustomPathBundle'),
+ 'kernel.bundles_metadata' => array('TestBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle\\Tests', 'parent' => null, 'path' => __DIR__.'/Fixtures/CustomPathBundle')),
+ ));
+
+ $calls = $container->getDefinition('validator.builder')->getMethodCalls();
+ $xmlMappings = $calls[3][1][0];
+ $this->assertCount(2, $xmlMappings);
+
+ try {
+ // Testing symfony/symfony
+ $this->assertStringEndsWith('Component'.DIRECTORY_SEPARATOR.'Form/Resources/config/validation.xml', $xmlMappings[0]);
+ } catch (\Exception $e) {
+ // Testing symfony/framework-bundle with deps=high
+ $this->assertStringEndsWith('symfony'.DIRECTORY_SEPARATOR.'form/Resources/config/validation.xml', $xmlMappings[0]);
+ }
+ $this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.xml', $xmlMappings[1]);
+
+ $yamlMappings = $calls[4][1][0];
+ $this->assertCount(1, $yamlMappings);
+ $this->assertStringEndsWith('CustomPathBundle/Resources/config/validation.yml', $yamlMappings[0]);
+ }
+
public function testValidationNoStaticMethod()
{
$container = $this->createContainerFromFile('validation_no_static_method');
@@ -472,6 +500,7 @@ protected function createContainer(array $data = array())
{
return new ContainerBuilder(new ParameterBag(array_merge(array(
'kernel.bundles' => array('FrameworkBundle' => 'Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle'),
+ 'kernel.bundles_metadata' => array('FrameworkBundle' => array('namespace' => 'Symfony\\Bundle\\FrameworkBundle', 'path' => __DIR__.'/../..', 'parent' => null)),
'kernel.cache_dir' => __DIR__,
'kernel.debug' => false,
'kernel.environment' => 'test',
@@ -558,7 +587,7 @@ private function assertUrlPackage(ContainerBuilder $container, DefinitionDecorat
private function assertVersionStrategy(ContainerBuilder $container, Reference $reference, $version, $format)
{
- $versionStrategy = $container->getDefinition($reference);
+ $versionStrategy = $container->getDefinition((string) $reference);
if (null === $version) {
$this->assertEquals('assets.empty_version_strategy', (string) $reference);
} else {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php
new file mode 100644
index 0000000000000..b97a6ba6a7c57
--- /dev/null
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/templates.php
@@ -0,0 +1,5 @@
+ __DIR__.'/../Fixtures/Resources/views/this.is.a.template.format.engine',
+);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fragment/LegacyContainerAwareHIncludeFragmentRendererTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fragment/LegacyContainerAwareHIncludeFragmentRendererTest.php
index 1757cfee9618c..cc85cdb02acb2 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fragment/LegacyContainerAwareHIncludeFragmentRendererTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fragment/LegacyContainerAwareHIncludeFragmentRendererTest.php
@@ -22,7 +22,7 @@ class LegacyContainerAwareHIncludeFragmentRendererTest extends TestCase
{
public function testRender()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container->expects($this->once())
->method('get')
->will($this->returnValue($this->getMockBuilder('\Twig_Environment')->disableOriginalConstructor()->getMock()))
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php
index 330e0659ca144..d90f5d8358f93 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php
@@ -214,7 +214,7 @@ public function getNonStringValues()
*/
private function getServiceContainer(RouteCollection $routes)
{
- $loader = $this->getMock('Symfony\Component\Config\Loader\LoaderInterface');
+ $loader = $this->getMockBuilder('Symfony\Component\Config\Loader\LoaderInterface')->getMock();
$loader
->expects($this->any())
@@ -222,7 +222,7 @@ private function getServiceContainer(RouteCollection $routes)
->will($this->returnValue($routes))
;
- $sc = $this->getMock('Symfony\\Component\\DependencyInjection\\Container', array('get'));
+ $sc = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\Container')->setMethods(array('get'))->getMock();
$sc
->expects($this->once())
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php
index 4eaafddfa4c68..d18427dc4e802 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/DelegatingEngineTest.php
@@ -85,7 +85,7 @@ public function testRenderResponseWithTemplatingEngine()
private function getEngineMock($template, $supports)
{
- $engine = $this->getMock('Symfony\Component\Templating\EngineInterface');
+ $engine = $this->getMockBuilder('Symfony\Component\Templating\EngineInterface')->getMock();
$engine->expects($this->once())
->method('supports')
@@ -97,7 +97,7 @@ private function getEngineMock($template, $supports)
private function getFrameworkEngineMock($template, $supports)
{
- $engine = $this->getMock('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface');
+ $engine = $this->getMockBuilder('Symfony\Bundle\FrameworkBundle\Templating\EngineInterface')->getMock();
$engine->expects($this->once())
->method('supports')
@@ -109,7 +109,7 @@ private function getFrameworkEngineMock($template, $supports)
private function getContainerMock($services)
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$i = 0;
foreach ($services as $id => $service) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
index 48a7737dd8080..46c9303096e62 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/GlobalVariablesTest.php
@@ -31,7 +31,7 @@ protected function setUp()
*/
public function testLegacyGetSecurity()
{
- $securityContext = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
+ $securityContext = $this->getMockBuilder('Symfony\Component\Security\Core\SecurityContextInterface')->getMock();
$this->assertNull($this->globals->getSecurity());
$this->container->set('security.context', $securityContext);
@@ -45,7 +45,7 @@ public function testGetUserNoTokenStorage()
public function testGetUserNoToken()
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
$this->container->set('security.token_storage', $tokenStorage);
$this->assertNull($this->globals->getUser());
}
@@ -55,8 +55,8 @@ public function testGetUserNoToken()
*/
public function testGetUser($user, $expectedUser)
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface');
- $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface')->getMock();
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
$this->container->set('security.token_storage', $tokenStorage);
@@ -75,9 +75,9 @@ public function testGetUser($user, $expectedUser)
public function getUserProvider()
{
- $user = $this->getMock('Symfony\Component\Security\Core\User\UserInterface');
+ $user = $this->getMockBuilder('Symfony\Component\Security\Core\User\UserInterface')->getMock();
$std = new \stdClass();
- $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface');
+ $token = $this->getMockBuilder('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')->getMock();
return array(
array($user, $user),
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/StopwatchHelperTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/StopwatchHelperTest.php
index 1a0ff5f548cee..3518267d81b67 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/StopwatchHelperTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/StopwatchHelperTest.php
@@ -17,7 +17,7 @@ class StopwatchHelperTest extends \PHPUnit_Framework_TestCase
{
public function testDevEnvironment()
{
- $stopwatch = $this->getMock('Symfony\Component\Stopwatch\Stopwatch');
+ $stopwatch = $this->getMockBuilder('Symfony\Component\Stopwatch\Stopwatch')->getMock();
$stopwatch->expects($this->once())
->method('start')
->with('foo');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php
index 1b28ec4f78deb..b00a14a06f004 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Loader/TemplateLocatorTest.php
@@ -35,6 +35,17 @@ public function testLocateATemplate()
$this->assertEquals('/path/to/template', $locator->locate($template));
}
+ public function testLocateATemplateFromCacheDir()
+ {
+ $template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine');
+
+ $fileLocator = $this->getFileLocator();
+
+ $locator = new TemplateLocator($fileLocator, __DIR__.'/../../Fixtures');
+
+ $this->assertEquals(realpath(__DIR__.'/../../Fixtures/Resources/views/this.is.a.template.format.engine'), $locator->locate($template));
+ }
+
public function testThrowsExceptionWhenTemplateNotFound()
{
$template = new TemplateReference('bundle', 'controller', 'name', 'format', 'engine');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php
index 479475732c0aa..aba568c51fa56 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php
@@ -22,7 +22,7 @@ class TemplateNameParserTest extends TestCase
protected function setUp()
{
- $kernel = $this->getMock('Symfony\Component\HttpKernel\KernelInterface');
+ $kernel = $this->getMockBuilder('Symfony\Component\HttpKernel\KernelInterface')->getMock();
$kernel
->expects($this->any())
->method('getBundle')
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php
index 9411c1cb4718d..ef01f0e3b815f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php
@@ -44,7 +44,7 @@ public function testThatRenderLogsTime()
*/
private function getContainer()
{
- return $this->getMock('Symfony\Component\DependencyInjection\Container');
+ return $this->getMockBuilder('Symfony\Component\DependencyInjection\Container')->getMock();
}
/**
@@ -52,8 +52,8 @@ private function getContainer()
*/
private function getTemplateNameParser()
{
- $templateReference = $this->getMock('Symfony\Component\Templating\TemplateReferenceInterface');
- $templateNameParser = $this->getMock('Symfony\Component\Templating\TemplateNameParserInterface');
+ $templateReference = $this->getMockBuilder('Symfony\Component\Templating\TemplateReferenceInterface')->getMock();
+ $templateNameParser = $this->getMockBuilder('Symfony\Component\Templating\TemplateNameParserInterface')->getMock();
$templateNameParser->expects($this->any())
->method('parse')
->will($this->returnValue($templateReference));
@@ -111,6 +111,6 @@ private function getStopwatchEvent()
*/
private function getStopwatch()
{
- return $this->getMock('Symfony\Component\Stopwatch\Stopwatch');
+ return $this->getMockBuilder('Symfony\Component\Stopwatch\Stopwatch')->getMock();
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php
index e09b0d3f33a85..11fe9da001e66 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php
@@ -76,7 +76,7 @@ public function testTransWithCaching()
$this->assertEquals('foobarbax (sr@latin)', $translator->trans('foobarbax'));
// do it another time as the cache is primed now
- $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
+ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
$loader->expects($this->never())->method('load');
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir));
@@ -96,7 +96,7 @@ public function testTransWithCaching()
public function testTransWithCachingWithInvalidLocale()
{
- $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
+ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir), 'loader', '\Symfony\Bundle\FrameworkBundle\Tests\Translation\TranslatorWithInvalidLocale');
$translator->setLocale('invalid locale');
@@ -121,7 +121,7 @@ public function testLoadResourcesWithoutCaching()
public function testGetDefaultLocale()
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->once())
->method('getParameter')
@@ -149,7 +149,7 @@ protected function getCatalogue($locale, $messages, $resources = array())
protected function getLoader()
{
- $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
+ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
$loader
->expects($this->at(0))
->method('load')
@@ -207,7 +207,7 @@ protected function getLoader()
protected function getContainer($loader)
{
- $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
+ $container = $this->getMockBuilder('Symfony\Component\DependencyInjection\ContainerInterface')->getMock();
$container
->expects($this->any())
->method('get')
@@ -248,7 +248,7 @@ public function testWarmup()
$translator->setFallbackLocales(array('fr'));
$translator->warmup($this->tmpDir);
- $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
+ $loader = $this->getMockBuilder('Symfony\Component\Translation\Loader\LoaderInterface')->getMock();
$loader
->expects($this->never())
->method('load');
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php
index b61851bb0c86a..12ee6ac673d97 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Validator/ConstraintValidatorFactoryTest.php
@@ -21,7 +21,7 @@ public function testGetInstanceCreatesValidator()
{
$class = get_class($this->getMockForAbstractClass('Symfony\\Component\\Validator\\ConstraintValidator'));
- $constraint = $this->getMock('Symfony\\Component\\Validator\\Constraint');
+ $constraint = $this->getMockBuilder('Symfony\\Component\\Validator\\Constraint')->getMock();
$constraint
->expects($this->once())
->method('validatedBy')
@@ -46,14 +46,14 @@ public function testGetInstanceReturnsService()
$validator = $this->getMockForAbstractClass('Symfony\\Component\\Validator\\ConstraintValidator');
// mock ContainerBuilder b/c it implements TaggedContainerInterface
- $container = $this->getMock('Symfony\\Component\\DependencyInjection\\ContainerBuilder', array('get'));
+ $container = $this->getMockBuilder('Symfony\\Component\\DependencyInjection\\ContainerBuilder')->setMethods(array('get'))->getMock();
$container
->expects($this->once())
->method('get')
->with($service)
->will($this->returnValue($validator));
- $constraint = $this->getMock('Symfony\\Component\\Validator\\Constraint');
+ $constraint = $this->getMockBuilder('Symfony\\Component\\Validator\\Constraint')->getMock();
$constraint
->expects($this->once())
->method('validatedBy')
@@ -68,7 +68,7 @@ public function testGetInstanceReturnsService()
*/
public function testGetInstanceInvalidValidatorClass()
{
- $constraint = $this->getMock('Symfony\\Component\\Validator\\Constraint');
+ $constraint = $this->getMockBuilder('Symfony\\Component\\Validator\\Constraint')->getMock();
$constraint
->expects($this->once())
->method('validatedBy')
diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json
index 9f62cb42e7de7..63c43e003506b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/composer.json
+++ b/src/Symfony/Bundle/FrameworkBundle/composer.json
@@ -23,7 +23,7 @@
"symfony/event-dispatcher": "~2.5",
"symfony/finder": "~2.0,>=2.0.5",
"symfony/http-foundation": "~2.7",
- "symfony/http-kernel": "~2.7.15|~2.8.8",
+ "symfony/http-kernel": "~2.7.23|~2.8.16",
"symfony/filesystem": "~2.3",
"symfony/routing": "~2.6,>2.6.4",
"symfony/security-core": "~2.6.13|~2.7.9|~2.8",
@@ -40,7 +40,7 @@
"symfony/dom-crawler": "~2.0,>=2.0.5",
"symfony/intl": "~2.3",
"symfony/security": "~2.6",
- "symfony/form": "~2.7,>=2.7.2",
+ "symfony/form": "~2.7.23|~2.8.16",
"symfony/class-loader": "~2.1",
"symfony/expression-language": "~2.6",
"symfony/process": "~2.0,>=2.0.5",
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
index 7aa4f5baa03eb..c6688affb40ae 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
@@ -96,7 +96,8 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
if (count($userProviders) === 0) {
throw new \RuntimeException('You must configure at least one remember-me aware listener (such as form-login) for each firewall that has remember-me enabled.');
}
- $rememberMeServices->replaceArgument(0, $userProviders);
+
+ $rememberMeServices->replaceArgument(0, array_unique($userProviders));
// remember-me listener
$listenerId = 'security.authentication.listener.rememberme.'.$id;
diff --git a/src/Symfony/Bundle/SecurityBundle/LICENSE b/src/Symfony/Bundle/SecurityBundle/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bundle/SecurityBundle/LICENSE
+++ b/src/Symfony/Bundle/SecurityBundle/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php
index acf4788adc7ee..c7845959ac42f 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php
@@ -54,7 +54,7 @@ public function testCollectWhenAuthenticationTokenIsNull()
*/
public function testLegacyCollectWhenAuthenticationTokenIsNull()
{
- $tokenStorage = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
+ $tokenStorage = $this->getMockBuilder('Symfony\Component\Security\Core\SecurityContextInterface')->getMock();
$collector = new SecurityDataCollector($tokenStorage, $this->getRoleHierarchy());
$collector->collect($this->getRequest(), $this->getResponse());
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
index 16e5787bdf60e..a07b3fc82910a 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
@@ -162,7 +162,7 @@ public function testAccess()
);
} elseif (3 === $i) {
$this->assertEquals('IS_AUTHENTICATED_ANONYMOUSLY', $attributes[0]);
- $expression = $container->getDefinition($attributes[1])->getArgument(0);
+ $expression = $container->getDefinition((string) $attributes[1])->getArgument(0);
$this->assertEquals("token.getUsername() matches '/^admin/'", $expression);
}
}
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php
index 9fbfd65950a53..711743a5af634 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExceptionListenerPass.php
@@ -27,8 +27,14 @@ public function process(ContainerBuilder $container)
return;
}
- // register the exception controller only if Twig is enabled
- if ($container->hasParameter('templating.engines')) {
+ if (!interface_exists('Symfony\Component\Templating\TemplateReferenceInterface')) {
+ $container->removeDefinition('twig.controller.exception');
+ }
+
+ // register the exception controller only if Twig is enabled and required dependencies do exist
+ if (!class_exists('Symfony\Component\Debug\Exception\FlattenException') || !interface_exists('Symfony\Component\EventDispatcher\EventSubscriberInterface')) {
+ $container->removeDefinition('twig.exception_listener');
+ } elseif ($container->hasParameter('templating.engines')) {
$engines = $container->getParameter('templating.engines');
if (!in_array('twig', $engines)) {
$container->removeDefinition('twig.exception_listener');
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
index d09de2d615c0a..36cea3d0fed1a 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php
@@ -23,10 +23,29 @@ class ExtensionPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
+ if (!class_exists('Symfony\Component\Asset\Packages')) {
+ $container->removeDefinition('twig.extension.assets');
+ }
+
+ if (!class_exists('Symfony\Component\ExpressionLanguage\Expression')) {
+ $container->removeDefinition('twig.extension.expression');
+ }
+
+ if (!interface_exists('Symfony\Component\Routing\Generator\UrlGeneratorInterface')) {
+ $container->removeDefinition('twig.extension.routing');
+ }
+ if (!interface_exists('Symfony\Component\Translation\TranslatorInterface')) {
+ $container->removeDefinition('twig.extension.trans');
+ }
+
+ if (!class_exists('Symfony\Component\Yaml\Yaml')) {
+ $container->removeDefinition('twig.extension.yaml');
+ }
+
if ($container->has('form.extension')) {
$container->getDefinition('twig.extension.form')->addTag('twig.extension');
$reflClass = new \ReflectionClass('Symfony\Bridge\Twig\Extension\FormExtension');
- $container->getDefinition('twig.loader.filesystem')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
+ $container->getDefinition('twig.loader.native_filesystem')->addMethodCall('addPath', array(dirname(dirname($reflClass->getFileName())).'/Resources/views/Form'));
}
if ($container->has('fragment.handler')) {
@@ -69,11 +88,13 @@ public function process(ContainerBuilder $container)
$container->getDefinition('twig.extension.debug')->addTag('twig.extension');
}
- if (!$container->has('templating')) {
- $loader = $container->getDefinition('twig.loader.native_filesystem');
- $loader->addTag('twig.loader');
- $loader->setMethodCalls($container->getDefinition('twig.loader.filesystem')->getMethodCalls());
+ $twigLoader = $container->getDefinition('twig.loader.native_filesystem');
+ if ($container->has('templating')) {
+ $loader = $container->getDefinition('twig.loader.filesystem');
+ $loader->setMethodCalls($twigLoader->getMethodCalls());
+ $twigLoader->clearTag('twig.loader');
+ } else {
$container->setAlias('twig.loader.filesystem', new Alias('twig.loader.native_filesystem', false));
}
diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
index 7b97e120baa4b..286c8f6bfabdc 100644
--- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
+++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php
@@ -36,6 +36,18 @@ public function load(array $configs, ContainerBuilder $container)
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('twig.xml');
+ if (class_exists('Symfony\Component\Form\Form')) {
+ $loader->load('form.xml');
+ }
+
+ if (interface_exists('Symfony\Component\Templating\EngineInterface')) {
+ $loader->load('templating.xml');
+ }
+
+ if (!interface_exists('Symfony\Component\Translation\TranslatorInterface')) {
+ $container->removeDefinition('twig.translation.extractor');
+ }
+
foreach ($configs as $key => $config) {
if (isset($config['globals'])) {
foreach ($config['globals'] as $name => $value) {
@@ -65,7 +77,7 @@ public function load(array $configs, ContainerBuilder $container)
$envConfiguratorDefinition->replaceArgument(4, $config['number_format']['decimal_point']);
$envConfiguratorDefinition->replaceArgument(5, $config['number_format']['thousands_separator']);
- $twigFilesystemLoaderDefinition = $container->getDefinition('twig.loader.filesystem');
+ $twigFilesystemLoaderDefinition = $container->getDefinition('twig.loader.native_filesystem');
// register user-configured paths
foreach ($config['paths'] as $path => $namespace) {
@@ -76,15 +88,19 @@ public function load(array $configs, ContainerBuilder $container)
}
}
- // register bundles as Twig namespaces
- foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
- if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$bundle.'/views')) {
- $this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
+ $bundleHierarchy = $this->getBundleHierarchy($container);
+
+ foreach ($bundleHierarchy as $name => $bundle) {
+ $namespace = $this->normalizeBundleName($name);
+
+ foreach ($bundle['children'] as $child) {
+ foreach ($bundleHierarchy[$child]['paths'] as $path) {
+ $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace));
+ }
}
- $reflection = new \ReflectionClass($class);
- if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/views')) {
- $this->addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle);
+ foreach ($bundle['paths'] as $path) {
+ $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($path, $namespace));
}
}
@@ -128,13 +144,63 @@ public function load(array $configs, ContainerBuilder $container)
));
}
- private function addTwigPath($twigFilesystemLoaderDefinition, $dir, $bundle)
+ private function getBundleHierarchy(ContainerBuilder $container)
+ {
+ $bundleHierarchy = array();
+
+ foreach ($container->getParameter('kernel.bundles_metadata') as $name => $bundle) {
+ if (!array_key_exists($name, $bundleHierarchy)) {
+ $bundleHierarchy[$name] = array(
+ 'paths' => array(),
+ 'parents' => array(),
+ 'children' => array(),
+ );
+ }
+
+ if (is_dir($dir = $container->getParameter('kernel.root_dir').'/Resources/'.$name.'/views')) {
+ $bundleHierarchy[$name]['paths'][] = $dir;
+ }
+
+ if (is_dir($dir = $bundle['path'].'/Resources/views')) {
+ $bundleHierarchy[$name]['paths'][] = $dir;
+ }
+
+ if (null === $bundle['parent']) {
+ continue;
+ }
+
+ $bundleHierarchy[$name]['parents'][] = $bundle['parent'];
+
+ if (!array_key_exists($bundle['parent'], $bundleHierarchy)) {
+ $bundleHierarchy[$bundle['parent']] = array(
+ 'paths' => array(),
+ 'parents' => array(),
+ 'children' => array(),
+ );
+ }
+
+ $bundleHierarchy[$bundle['parent']]['children'] = array_merge($bundleHierarchy[$name]['children'], array($name), $bundleHierarchy[$bundle['parent']]['children']);
+
+ foreach ($bundleHierarchy[$bundle['parent']]['parents'] as $parent) {
+ $bundleHierarchy[$name]['parents'][] = $parent;
+ $bundleHierarchy[$parent]['children'] = array_merge($bundleHierarchy[$name]['children'], array($name), $bundleHierarchy[$parent]['children']);
+ }
+
+ foreach ($bundleHierarchy[$name]['children'] as $child) {
+ $bundleHierarchy[$child]['parents'] = array_merge($bundleHierarchy[$child]['parents'], $bundleHierarchy[$name]['parents']);
+ }
+ }
+
+ return $bundleHierarchy;
+ }
+
+ private function normalizeBundleName($name)
{
- $name = $bundle;
if ('Bundle' === substr($name, -6)) {
$name = substr($name, 0, -6);
}
- $twigFilesystemLoaderDefinition->addMethodCall('addPath', array($dir, $name));
+
+ return $name;
}
/**
diff --git a/src/Symfony/Bundle/TwigBundle/LICENSE b/src/Symfony/Bundle/TwigBundle/LICENSE
index 12a74531e40a4..17d16a13367dd 100644
--- a/src/Symfony/Bundle/TwigBundle/LICENSE
+++ b/src/Symfony/Bundle/TwigBundle/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2016 Fabien Potencier
+Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/form.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/form.xml
new file mode 100644
index 0000000000000..0703f0f57774a
--- /dev/null
+++ b/src/Symfony/Bundle/TwigBundle/Resources/config/form.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+ %twig.form.resources%
+
+
+
+
+
+
+
+
diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml
new file mode 100644
index 0000000000000..c1c57d928da71
--- /dev/null
+++ b/src/Symfony/Bundle/TwigBundle/Resources/config/templating.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
index f2c2a4cee007c..457cb5c06abf1 100644
--- a/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
+++ b/src/Symfony/Bundle/TwigBundle/Resources/config/twig.xml
@@ -53,24 +53,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -130,21 +117,8 @@
-
-
-
-
-
- %twig.form.resources%
-
-
-
-
-
-
-