Merge branch '3.0' into 3.1

* 3.0:
  [travis] Fix deps=low/high builds
  fixed CS
  skip test with current phpunit bridge
  Fix for #19183 to add support for new PHP MongoDB extension in sessions.
  [Console] Fix for block() padding formatting after #19189
  [Security][Guard] check if session exist before using it
  bumped Symfony version to 3.0.9
  updated VERSION for 3.0.8
  updated CHANGELOG for 3.0.8
  bumped Symfony version to 2.8.9
  updated VERSION for 2.8.8
  updated CHANGELOG for 2.8.8
  bumped Symfony version to 2.7.16
  updated VERSION for 2.7.15
  update CONTRIBUTORS for 2.7.15
  updated CHANGELOG for 2.7.15
  Fix some lowest deps
  Fixed typos in the expectedException annotations

Conflicts:
	src/Symfony/Component/HttpKernel/Kernel.php
	src/Symfony/Component/Security/Guard/Authenticator/AbstractFormLoginAuthenticator.php
This commit is contained in:
Nicolas Grekas 2016-07-01 18:00:00 +02:00
commit 3726aa15dd
18 changed files with 523 additions and 158 deletions

4
.github/travis.php vendored
View File

@ -46,8 +46,8 @@ foreach ($dirs as $dir) {
$versions = @file_get_contents('https://packagist.org/packages/'.$package->name.'.json') ?: '{"package":{"versions":[]}}'; $versions = @file_get_contents('https://packagist.org/packages/'.$package->name.'.json') ?: '{"package":{"versions":[]}}';
$versions = json_decode($versions); $versions = json_decode($versions);
foreach ($versions->package->versions as $version => $package) { foreach ($versions->package->versions as $v => $package) {
$packages[$package->name] += array($version => $package); $packages[$package->name] += array($v => $package);
} }
} }

View File

@ -7,6 +7,39 @@ in 3.0 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 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/v3.0.0...v3.0.1 To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v3.0.0...v3.0.1
* 3.0.8 (2016-06-30)
* bug #19217 [HttpKernel] Inline ValidateRequestListener logic into HttpKernel (nicolas-grekas)
* bug #18688 [HttpFoundation] Warning when request has both Forwarded and X-Forwarded-For (magnusnordlander)
* bug #19173 [Console] Decouple SymfonyStyle from TableCell (ro0NL)
* bug #19189 [Console] Fix formatting of SymfonyStyle::comment() (chalasr)
* bug #19211 [Form] fix post max size translation type extension for >= 2.8 (Tobion)
* bug #17822 [WIP] [Form] fix `empty_data` option in expanded `ChoiceType` (HeahDude)
* bug #19134 Distinguish between first and subsequent progress bar displays (rquadling)
* bug #19061 [FORM] fix post_max_size_message translation (alt. 2) (David Badura)
* bug #19100 [Console] Fixed SymfonyQuestionHelper multi-choice with defaults (sstok)
* bug #18924 [DoctrineBridge] Don't use object IDs in DoctrineChoiceLoader when passing a value closure (webmozart)
* bug #19138 [DomCrawler] No more exception on field name with strange format (guiled, fabpot)
* bug #18935 [Form] Consider a violation even if the form is not submitted (egeloen)
* bug #19127 [Form] Add exception to FormRenderer about non-unique block names (enumag)
* bug #19118 [Process] Fix pipes cleaning on Windows (nicolas-grekas)
* bug #19128 Avoid phpunit 5.4 warnings on getMock (2.7+) (iltar)
* bug #19114 [HttpKernel] Dont close the reponse stream in debug (nicolas-grekas)
* bug #19101 [Session] fix PDO transaction aborted under PostgreSQL (Tobion)
* bug #18501 [HttpFoundation] changed MERGE queries (hjkl)
* bug #19062 [HttpFoundation] Fix UPSERT for PgSql >= 9.5 (nicolas-grekas)
* bug #18548 [Form] minor fixes in DateTime transformers (HeahDude)
* bug #18732 [PropertyAccess][DX] Enhance exception that say that some methods are missing if they don't (nykopol)
* bug #19048 [HttpFoundation] Use UPSERT for sessions stored in PgSql >= 9.5 (nicolas-grekas)
* bug #19038 Fix feature detection for IE (Alsciende)
* bug #18915 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)
* bug #19020 [Form] Fixed collapsed choice attributes (HeahDude)
* bug #19028 [Yaml] properly count skipped comment lines (xabbuh)
* bug #19009 [WebProfilerBundle] Fix invalid CSS style (romainneutron)
* bug #17733 [Yaml] Fix wrong line number when comments are inserted in the middle of a block. (paradajozsef)
* bug #18911 Fixed singular of committee (peterrehm)
* bug #18971 Do not inject web debug toolbar on attachments (peterrehm)
* 3.0.7 (2016-06-06) * 3.0.7 (2016-06-06)
* bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh) * bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)

View File

@ -8,8 +8,8 @@ Symfony is the result of the work of many people who made the code better
- Nicolas Grekas (nicolas-grekas) - Nicolas Grekas (nicolas-grekas)
- Bernhard Schussek (bschussek) - Bernhard Schussek (bschussek)
- Tobias Schultze (tobion) - Tobias Schultze (tobion)
- Christophe Coevoet (stof)
- Christian Flothmann (xabbuh) - Christian Flothmann (xabbuh)
- Christophe Coevoet (stof)
- Jordi Boggiano (seldaek) - Jordi Boggiano (seldaek)
- Victor Berchet (victor) - Victor Berchet (victor)
- Johannes S (johannes) - Johannes S (johannes)
@ -17,12 +17,12 @@ Symfony is the result of the work of many people who made the code better
- Jakub Zalas (jakubzalas) - Jakub Zalas (jakubzalas)
- Ryan Weaver (weaverryan) - Ryan Weaver (weaverryan)
- Javier Eguiluz (javier.eguiluz) - Javier Eguiluz (javier.eguiluz)
- Hugo Hamon (hhamon)
- Kévin Dunglas (dunglas) - Kévin Dunglas (dunglas)
- Hugo Hamon (hhamon)
- Abdellatif Ait boudad (aitboudad) - Abdellatif Ait boudad (aitboudad)
- Pascal Borreli (pborreli) - Pascal Borreli (pborreli)
- Joseph Bielawski (stloyd)
- Wouter De Jong (wouterj) - Wouter De Jong (wouterj)
- Joseph Bielawski (stloyd)
- Romain Neutron (romain) - Romain Neutron (romain)
- Karma Dordrak (drak) - Karma Dordrak (drak)
- Lukas Kahwe Smith (lsmith) - Lukas Kahwe Smith (lsmith)
@ -34,16 +34,16 @@ Symfony is the result of the work of many people who made the code better
- Grégoire Pineau (lyrixx) - Grégoire Pineau (lyrixx)
- Eriksen Costa (eriksencosta) - Eriksen Costa (eriksencosta)
- Sarah Khalil (saro0h) - Sarah Khalil (saro0h)
- Jules Pietri (heah)
- Jonathan Wage (jwage) - Jonathan Wage (jwage)
- Diego Saint Esteben (dosten)
- Maxime Steinhausser (ogizanagi) - Maxime Steinhausser (ogizanagi)
- Diego Saint Esteben (dosten)
- Alexandre Salomé (alexandresalome) - Alexandre Salomé (alexandresalome)
- William Durand (couac) - William Durand (couac)
- Jules Pietri (heah)
- ornicar - ornicar
- Francis Besset (francisbesset)
- stealth35 (stealth35) - stealth35 (stealth35)
- Alexander Mols (asm89) - Alexander Mols (asm89)
- Francis Besset (francisbesset)
- Bulat Shakirzyanov (avalanche123) - Bulat Shakirzyanov (avalanche123)
- Saša Stamenković (umpirsky) - Saša Stamenković (umpirsky)
- Henrik Bjørnskov (henrikbjorn) - Henrik Bjørnskov (henrikbjorn)
@ -52,21 +52,21 @@ Symfony is the result of the work of many people who made the code better
- Konstantin Kudryashov (everzet) - Konstantin Kudryashov (everzet)
- Bilal Amarni (bamarni) - Bilal Amarni (bamarni)
- Florin Patan (florinpatan) - Florin Patan (florinpatan)
- Kevin Bond (kbond)
- Peter Rehm (rpet) - Peter Rehm (rpet)
- Kevin Bond (kbond)
- Gábor Egyed (1ed) - Gábor Egyed (1ed)
- Ener-Getick (energetick)
- Michel Weimerskirch (mweimerskirch) - Michel Weimerskirch (mweimerskirch)
- Eric Clemmons (ericclemmons) - Eric Clemmons (ericclemmons)
- Iltar van der Berg (kjarli)
- Andrej Hudec (pulzarraider) - Andrej Hudec (pulzarraider)
- Christian Raue - Christian Raue
- Charles Sarrazin (csarrazi)
- Matthias Pigulla (mpdude) - Matthias Pigulla (mpdude)
- Deni - Deni
- Henrik Westphal (snc) - Henrik Westphal (snc)
- Dariusz Górecki (canni) - Dariusz Górecki (canni)
- Arnout Boks (aboks) - Arnout Boks (aboks)
- Iltar van der Berg (kjarli)
- Charles Sarrazin (csarrazi)
- Ener-Getick (energetick)
- Douglas Greenshields (shieldo) - Douglas Greenshields (shieldo)
- Lee McDermott - Lee McDermott
- Brandon Turner - Brandon Turner
@ -82,49 +82,50 @@ Symfony is the result of the work of many people who made the code better
- Antoine Hérault (herzult) - Antoine Hérault (herzult)
- Arnaud Le Blanc (arnaud-lb) - Arnaud Le Blanc (arnaud-lb)
- Jérôme Tamarelle (gromnan) - Jérôme Tamarelle (gromnan)
- Paráda József (paradajozsef)
- Michal Piotrowski (eventhorizon) - Michal Piotrowski (eventhorizon)
- Tim Nagel (merk) - Tim Nagel (merk)
- Paráda József (paradajozsef)
- Brice BERNARD (brikou) - Brice BERNARD (brikou)
- Robin Chalas (chalas_r)
- Alexander M. Turek (derrabus) - Alexander M. Turek (derrabus)
- Dariusz Ruminski - Dariusz Ruminski
- marc.weistroff - marc.weistroff
- Issei Murasawa (issei_m) - Issei Murasawa (issei_m)
- lenar - lenar
- Włodzimierz Gajda (gajdaw) - Włodzimierz Gajda (gajdaw)
- Konstantin Myakshin (koc)
- Baptiste Clavié (talus)
- Alexander Schwenn (xelaris) - Alexander Schwenn (xelaris)
- Florian Voutzinos (florianv) - Florian Voutzinos (florianv)
- Konstantin Myakshin (koc)
- Colin Frei - Colin Frei
- Adrien Brault (adrienbrault) - Adrien Brault (adrienbrault)
- Joshua Thijssen - Joshua Thijssen
- Baptiste Clavié (talus)
- Peter Kokot (maastermedia) - Peter Kokot (maastermedia)
- excelwebzone - excelwebzone
- Jacob Dreesen (jdreesen) - Jacob Dreesen (jdreesen)
- Jáchym Toušek (enumag)
- Jérémy DERUSSÉ (jderusse) - Jérémy DERUSSÉ (jderusse)
- Vladimir Reznichenko (kalessil) - Vladimir Reznichenko (kalessil)
- Tomáš Votruba (tomas_votruba)
- Fabien Pennequin (fabienpennequin) - Fabien Pennequin (fabienpennequin)
- Gordon Franke (gimler) - Gordon Franke (gimler)
- Eric GELOEN (gelo)
- David Buchmann (dbu) - David Buchmann (dbu)
- Tomáš Votruba (tomas_votruba)
- Jáchym Toušek
- Robert Schönthal (digitalkaoz) - Robert Schönthal (digitalkaoz)
- Florian Lonqueu-Brochard (florianlb) - Florian Lonqueu-Brochard (florianlb)
- Eric GELOEN (gelo)
- Stefano Sala (stefano.sala) - Stefano Sala (stefano.sala)
- Juti Noppornpitak (shiroyuki) - Juti Noppornpitak (shiroyuki)
- Titouan Galopin (tgalopin)
- Tigran Azatyan (tigranazatyan) - Tigran Azatyan (tigranazatyan)
- Sebastian Hörl (blogsh) - Sebastian Hörl (blogsh)
- Daniel Gomes (danielcsgomes) - Daniel Gomes (danielcsgomes)
- Hidenori Goto (hidenorigoto) - Hidenori Goto (hidenorigoto)
- Sebastiaan Stok (sstok)
- Evgeniy (ewgraf) - Evgeniy (ewgraf)
- Tugdual Saunier (tucksaun)
- Guilherme Blanco (guilhermeblanco) - Guilherme Blanco (guilhermeblanco)
- Pablo Godel (pgodel) - Pablo Godel (pgodel)
- Titouan Galopin (tgalopin)
- Jérémie Augustin (jaugustin) - Jérémie Augustin (jaugustin)
- Sebastiaan Stok (sstok)
- Tugdual Saunier (tucksaun)
- Andréia Bohner (andreia) - Andréia Bohner (andreia)
- Rafael Dohms (rdohms) - Rafael Dohms (rdohms)
- Arnaud Kleinpeter (nanocom) - Arnaud Kleinpeter (nanocom)
@ -141,6 +142,7 @@ Symfony is the result of the work of many people who made the code better
- Richard van Laak (rvanlaak) - Richard van Laak (rvanlaak)
- Matthieu Ouellette-Vachon (maoueh) - Matthieu Ouellette-Vachon (maoueh)
- Michał Pipa (michal.pipa) - Michał Pipa (michal.pipa)
- Javier Spagnoletti (phansys)
- Amal Raghav (kertz) - Amal Raghav (kertz)
- Jonathan Ingram (jonathaningram) - Jonathan Ingram (jonathaningram)
- Artur Kotyrba - Artur Kotyrba
@ -150,7 +152,6 @@ Symfony is the result of the work of many people who made the code better
- Daniel Wehner - Daniel Wehner
- Possum - Possum
- Dorian Villet (gnutix) - Dorian Villet (gnutix)
- Javier Spagnoletti (phansys)
- Richard Miller (mr_r_miller) - Richard Miller (mr_r_miller)
- Mario A. Alvarez Garcia (nomack84) - Mario A. Alvarez Garcia (nomack84)
- Dennis Benkert (denderello) - Dennis Benkert (denderello)
@ -179,6 +180,7 @@ Symfony is the result of the work of many people who made the code better
- Sven Paulus (subsven) - Sven Paulus (subsven)
- Lars Strojny (lstrojny) - Lars Strojny (lstrojny)
- Rui Marinho (ruimarinho) - Rui Marinho (ruimarinho)
- Daniel Espendiller
- Eugene Wissner - Eugene Wissner
- Julien Brochet (mewt) - Julien Brochet (mewt)
- Sergey Linnik (linniksa) - Sergey Linnik (linniksa)
@ -212,9 +214,7 @@ Symfony is the result of the work of many people who made the code better
- Kristen Gilden (kgilden) - Kristen Gilden (kgilden)
- Dawid Nowak - Dawid Nowak
- Pierre-Yves LEBECQ (pylebecq) - Pierre-Yves LEBECQ (pylebecq)
- Daniel Espendiller
- Jakub Kucharovic (jkucharovic) - Jakub Kucharovic (jkucharovic)
- Robin Chalas (chalas_r)
- Eugene Leonovich (rybakit) - Eugene Leonovich (rybakit)
- Filippo Tessarotto - Filippo Tessarotto
- Joseph Rouff (rouffj) - Joseph Rouff (rouffj)
@ -238,6 +238,7 @@ Symfony is the result of the work of many people who made the code better
- Roumen Damianoff (roumen) - Roumen Damianoff (roumen)
- Antonio J. García Lagar (ajgarlag) - Antonio J. García Lagar (ajgarlag)
- Kim Hemsø Rasmussen (kimhemsoe) - Kim Hemsø Rasmussen (kimhemsoe)
- Christian Schmidt
- Wouter Van Hecke - Wouter Van Hecke
- Peter Kruithof (pkruithof) - Peter Kruithof (pkruithof)
- Michael Holm (hollo) - Michael Holm (hollo)
@ -245,6 +246,7 @@ Symfony is the result of the work of many people who made the code better
- Hidde Wieringa (hiddewie) - Hidde Wieringa (hiddewie)
- Chris Smith (cs278) - Chris Smith (cs278)
- Florian Klein (docteurklein) - Florian Klein (docteurklein)
- Oleg Voronkovich
- Manuel Kiessling (manuelkiessling) - Manuel Kiessling (manuelkiessling)
- Daniel Wehner - Daniel Wehner
- Atsuhiro KUBO (iteman) - Atsuhiro KUBO (iteman)
@ -294,7 +296,6 @@ Symfony is the result of the work of many people who made the code better
- Inal DJAFAR (inalgnu) - Inal DJAFAR (inalgnu)
- Christian Gärtner (dagardner) - Christian Gärtner (dagardner)
- Tomasz Kowalczyk (thunderer) - Tomasz Kowalczyk (thunderer)
- Christian Schmidt
- François-Xavier de Guillebon (de-gui_f) - François-Xavier de Guillebon (de-gui_f)
- Damien Alexandre (damienalexandre) - Damien Alexandre (damienalexandre)
- Felix Labrecque - Felix Labrecque
@ -322,6 +323,7 @@ Symfony is the result of the work of many people who made the code better
- Endre Fejes - Endre Fejes
- Tobias Naumann (tna) - Tobias Naumann (tna)
- Daniel Beyer - Daniel Beyer
- Jhonny Lidfors (jhonne)
- Shein Alexey - Shein Alexey
- Baptiste Lafontaine - Baptiste Lafontaine
- Joe Lencioni - Joe Lencioni
@ -335,7 +337,6 @@ Symfony is the result of the work of many people who made the code better
- Ivan Kurnosov - Ivan Kurnosov
- Xavier HAUSHERR - Xavier HAUSHERR
- Albert Jessurum (ajessu) - Albert Jessurum (ajessu)
- Oleg Voronkovich
- Laszlo Korte - Laszlo Korte
- Pavel Batanov (scaytrase) - Pavel Batanov (scaytrase)
- Miha Vrhovnik - Miha Vrhovnik
@ -355,6 +356,7 @@ Symfony is the result of the work of many people who made the code better
- Brian King - Brian King
- Michel Salib (michelsalib) - Michel Salib (michelsalib)
- geoffrey - geoffrey
- Steffen Roßkamp
- Valentin Jonovs (valentins-jonovs) - Valentin Jonovs (valentins-jonovs)
- Jeanmonod David (jeanmonod) - Jeanmonod David (jeanmonod)
- Jan Schumann - Jan Schumann
@ -364,6 +366,7 @@ Symfony is the result of the work of many people who made the code better
- Mihai Stancu - Mihai Stancu
- Olivier Dolbeau (odolbeau) - Olivier Dolbeau (odolbeau)
- Jan Rosier (rosier) - Jan Rosier (rosier)
- Magnus Nordlander (magnusnordlander)
- vagrant - vagrant
- EdgarPE - EdgarPE
- Florian Pfitzer (marmelatze) - Florian Pfitzer (marmelatze)
@ -379,6 +382,7 @@ Symfony is the result of the work of many people who made the code better
- Christian Schmidt - Christian Schmidt
- Marek Štípek (maryo) - Marek Štípek (maryo)
- Marcin Sikoń (marphi) - Marcin Sikoń (marphi)
- Roland Franssen (ro0)
- Dominik Zogg (dominik.zogg) - Dominik Zogg (dominik.zogg)
- Marek Pietrzak - Marek Pietrzak
- Chad Sikorra (chadsikorra) - Chad Sikorra (chadsikorra)
@ -390,6 +394,7 @@ Symfony is the result of the work of many people who made the code better
- Zander Baldwin - Zander Baldwin
- Adam Harvey - Adam Harvey
- Alex Bakhturin - Alex Bakhturin
- Alexander Obuhovich (aik099)
- boombatower - boombatower
- Fabrice Bernhard (fabriceb) - Fabrice Bernhard (fabriceb)
- Jérôme Macias (jeromemacias) - Jérôme Macias (jeromemacias)
@ -412,10 +417,12 @@ Symfony is the result of the work of many people who made the code better
- ondrowan - ondrowan
- Barry vd. Heuvel (barryvdh) - Barry vd. Heuvel (barryvdh)
- Jerzy Zawadzki (jzawadzki) - Jerzy Zawadzki (jzawadzki)
- Théo FIDRY (theofidry)
- Evan S Kaufman (evanskaufman) - Evan S Kaufman (evanskaufman)
- mcben - mcben
- Jérôme Vieilledent (lolautruche) - Jérôme Vieilledent (lolautruche)
- Maks Slesarenko - Maks Slesarenko
- Filip Procházka (fprochazka)
- mmoreram - mmoreram
- Markus Lanthaler (lanthaler) - Markus Lanthaler (lanthaler)
- Vicent Soria Durá (vicentgodella) - Vicent Soria Durá (vicentgodella)
@ -440,7 +447,6 @@ Symfony is the result of the work of many people who made the code better
- Benjamin Leveque (benji07) - Benjamin Leveque (benji07)
- Nate (frickenate) - Nate (frickenate)
- jhonnyL - jhonnyL
- Jhonny Lidfors (jhonne)
- sasezaki - sasezaki
- Dawid Pakuła (zulusx) - Dawid Pakuła (zulusx)
- Florian Rey (nervo) - Florian Rey (nervo)
@ -503,6 +509,7 @@ Symfony is the result of the work of many people who made the code better
- Maxime Douailin - Maxime Douailin
- Javier López (loalf) - Javier López (loalf)
- Reinier Kip - Reinier Kip
- Geoffrey Brier (geoffrey-brier)
- Dustin Dobervich (dustin10) - Dustin Dobervich (dustin10)
- dantleech - dantleech
- Anne-Sophie Bachelard (annesophie) - Anne-Sophie Bachelard (annesophie)
@ -535,9 +542,11 @@ Symfony is the result of the work of many people who made the code better
- Arturs Vonda - Arturs Vonda
- Sascha Grossenbacher - Sascha Grossenbacher
- Szijarto Tamas - Szijarto Tamas
- David Badura (davidbadura)
- Catalin Dan - Catalin Dan
- Stephan Vock - Stephan Vock
- Benjamin Zikarsky (bzikarsky) - Benjamin Zikarsky (bzikarsky)
- Anton Bakai
- Simon Schick (simonsimcity) - Simon Schick (simonsimcity)
- redstar504 - redstar504
- Tristan Roussel - Tristan Roussel
@ -556,7 +565,7 @@ Symfony is the result of the work of many people who made the code better
- Richard van den Brand (ricbra) - Richard van den Brand (ricbra)
- develop - develop
- Mark Sonnabaum - Mark Sonnabaum
- Alexander Obuhovich (aik099) - Richard Quadling
- jochenvdv - jochenvdv
- Arturas Smorgun (asarturas) - Arturas Smorgun (asarturas)
- Alexander Volochnev (exelenz) - Alexander Volochnev (exelenz)
@ -573,6 +582,7 @@ Symfony is the result of the work of many people who made the code better
- Baldur Rensch (brensch) - Baldur Rensch (brensch)
- Vladyslav Petrovych - Vladyslav Petrovych
- Alex Xandra Albert Sim - Alex Xandra Albert Sim
- Carson Full
- Trent Steel (trsteel88) - Trent Steel (trsteel88)
- Yuen-Chi Lian - Yuen-Chi Lian
- Besnik Br - Besnik Br
@ -589,6 +599,7 @@ Symfony is the result of the work of many people who made the code better
- Leevi Graham (leevigraham) - Leevi Graham (leevigraham)
- Casper Valdemar Poulsen - Casper Valdemar Poulsen
- Josiah (josiah) - Josiah (josiah)
- Joschi Kuphal
- John Bohn (jbohn) - John Bohn (jbohn)
- Marc Morera (mmoreram) - Marc Morera (mmoreram)
- Andrew Hilobok (hilobok) - Andrew Hilobok (hilobok)
@ -618,7 +629,6 @@ Symfony is the result of the work of many people who made the code better
- Adrien Lucas (adrienlucas) - Adrien Lucas (adrienlucas)
- James Michael DuPont - James Michael DuPont
- Tom Klingenberg - Tom Klingenberg
- Filip Procházka (fprochazka)
- Christopher Hall (mythmakr) - Christopher Hall (mythmakr)
- Paul Kamer (pkamer) - Paul Kamer (pkamer)
- Rafał Wrzeszcz (rafalwrzeszcz) - Rafał Wrzeszcz (rafalwrzeszcz)
@ -637,7 +647,6 @@ Symfony is the result of the work of many people who made the code better
- Neil Ferreira - Neil Ferreira
- Nathanael Noblet (gnat) - Nathanael Noblet (gnat)
- Dmitry Parnas (parnas) - Dmitry Parnas (parnas)
- Théo FIDRY (theofidry)
- Paul LE CORRE - Paul LE CORRE
- DQNEO - DQNEO
- Emanuele Iannone - Emanuele Iannone
@ -652,7 +661,6 @@ Symfony is the result of the work of many people who made the code better
- Matt Robinson (inanimatt) - Matt Robinson (inanimatt)
- Aleksey Podskrebyshev - Aleksey Podskrebyshev
- Calin Mihai Pristavu - Calin Mihai Pristavu
- Steffen Roßkamp
- David Marín Carreño (davefx) - David Marín Carreño (davefx)
- Jörn Lang (j.lang) - Jörn Lang (j.lang)
- Omar Yepez (oyepez003) - Omar Yepez (oyepez003)
@ -677,6 +685,7 @@ Symfony is the result of the work of many people who made the code better
- Don Pinkster - Don Pinkster
- Maksim Muruev - Maksim Muruev
- Emil Einarsson - Emil Einarsson
- Thomas Landauer
- Thibault Duplessis - Thibault Duplessis
- Marc Abramowitz - Marc Abramowitz
- Martijn Evers - Martijn Evers
@ -697,7 +706,6 @@ Symfony is the result of the work of many people who made the code better
- David Lima - David Lima
- Jérôme Vasseur - Jérôme Vasseur
- Brunet Laurent (lbrunet) - Brunet Laurent (lbrunet)
- Magnus Nordlander (magnusnordlander)
- Mikhail Yurasov (mym) - Mikhail Yurasov (mym)
- LOUARDI Abdeltif (ouardisoft) - LOUARDI Abdeltif (ouardisoft)
- Robert Gruendler (pulse00) - Robert Gruendler (pulse00)
@ -709,6 +717,7 @@ Symfony is the result of the work of many people who made the code better
- Raul Fraile (raulfraile) - Raul Fraile (raulfraile)
- sensio - sensio
- Patrick Kaufmann - Patrick Kaufmann
- Piotr Stankowski
- Reece Fowell (reecefowell) - Reece Fowell (reecefowell)
- Mátyás Somfai (smatyas) - Mátyás Somfai (smatyas)
- stefan.r - stefan.r
@ -728,6 +737,7 @@ Symfony is the result of the work of many people who made the code better
- Pieter - Pieter
- Michael Tibben - Michael Tibben
- Sander Marechal - Sander Marechal
- Andre Rømcke (andrerom)
- Radosław Benkel - Radosław Benkel
- ttomor - ttomor
- Mei Gwilym (meigwilym) - Mei Gwilym (meigwilym)
@ -743,6 +753,7 @@ Symfony is the result of the work of many people who made the code better
- Danilo Silva - Danilo Silva
- Zachary Tong (polyfractal) - Zachary Tong (polyfractal)
- Hryhorii Hrebiniuk - Hryhorii Hrebiniuk
- Dennis Fridrich (dfridrich)
- mcfedr (mcfedr) - mcfedr (mcfedr)
- hamza - hamza
- dantleech - dantleech
@ -752,6 +763,7 @@ Symfony is the result of the work of many people who made the code better
- Guillaume Royer - Guillaume Royer
- Artem (digi) - Artem (digi)
- boite - boite
- MGDSoft
- Vadim Tyukov (vatson) - Vadim Tyukov (vatson)
- Sortex - Sortex
- chispita - chispita
@ -804,10 +816,12 @@ Symfony is the result of the work of many people who made the code better
- Benoit Garret - Benoit Garret
- Thomas Royer (cydonia7) - Thomas Royer (cydonia7)
- DerManoMann - DerManoMann
- Olaf Klischat
- Jhonny Lidfors (jhonny) - Jhonny Lidfors (jhonny)
- Julien Bianchi (jubianchi) - Julien Bianchi (jubianchi)
- Robert Meijers
- Marcin Chwedziak - Marcin Chwedziak
- Roland Franssen (ro0) - hjkl
- Tony Cosentino (tony-co) - Tony Cosentino (tony-co)
- Rodrigo Díez Villamuera (rodrigodiez) - Rodrigo Díez Villamuera (rodrigodiez)
- e-ivanov - e-ivanov
@ -815,6 +829,7 @@ Symfony is the result of the work of many people who made the code better
- Jeremy Bush - Jeremy Bush
- wizhippo - wizhippo
- Viacheslav Sychov - Viacheslav Sychov
- Carlos Ortega Huetos
- rpg600 - rpg600
- Péter Buri (burci) - Péter Buri (burci)
- Davide Borsatto (davide.borsatto) - Davide Borsatto (davide.borsatto)
@ -834,6 +849,7 @@ Symfony is the result of the work of many people who made the code better
- spdionis - spdionis
- Eduardo García Sanz (coma) - Eduardo García Sanz (coma)
- James Gilliland - James Gilliland
- Rhodri Pugh (rodnaph)
- David de Boer (ddeboer) - David de Boer (ddeboer)
- Gilles Doge (gido) - Gilles Doge (gido)
- abulford - abulford
@ -855,7 +871,6 @@ Symfony is the result of the work of many people who made the code better
- Juan Traverso - Juan Traverso
- Philipp Strube - Philipp Strube
- Christian Sciberras - Christian Sciberras
- Anton Bakai
- Clement Herreman (clemherreman) - Clement Herreman (clemherreman)
- Dan Ionut Dumitriu (danionut90) - Dan Ionut Dumitriu (danionut90)
- Nyro (nyro) - Nyro (nyro)
@ -893,7 +908,6 @@ Symfony is the result of the work of many people who made the code better
- azine - azine
- Dawid Sajdak - Dawid Sajdak
- Ludek Stepan - Ludek Stepan
- Geoffrey Brier
- Aaron Stephens (astephens) - Aaron Stephens (astephens)
- Craig Menning (cmenning) - Craig Menning (cmenning)
- Balázs Benyó (duplabe) - Balázs Benyó (duplabe)
@ -917,6 +931,7 @@ Symfony is the result of the work of many people who made the code better
- Cédric Lahouste (rapotor) - Cédric Lahouste (rapotor)
- Samuel Vogel (samuelvogel) - Samuel Vogel (samuelvogel)
- Berat Doğan - Berat Doğan
- Juanmi Rodriguez Cerón
- Anthony Ferrara - Anthony Ferrara
- Klaas Cuvelier (kcuvelier) - Klaas Cuvelier (kcuvelier)
- Steve Frécinaux - Steve Frécinaux
@ -934,6 +949,7 @@ Symfony is the result of the work of many people who made the code better
- Philip Frank - Philip Frank
- Lance McNearney - Lance McNearney
- Giorgio Premi - Giorgio Premi
- Ian Carroll
- caponica - caponica
- Matt Daum (daum) - Matt Daum (daum)
- Alberto Pirovano (geezmo) - Alberto Pirovano (geezmo)
@ -945,6 +961,7 @@ Symfony is the result of the work of many people who made the code better
- Max Summe - Max Summe
- WedgeSama - WedgeSama
- Felds Liscia - Felds Liscia
- Ahmed TAILOULOUTE (ahmedtai)
- James Halsall (jaitsu) - James Halsall (jaitsu)
- Maxime Veber (nek-) - Maxime Veber (nek-)
- Sullivan SENECHAL - Sullivan SENECHAL
@ -968,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
- Max Romanovsky (maxromanovsky) - Max Romanovsky (maxromanovsky)
- Mathieu Morlon - Mathieu Morlon
- Daniel Tschinder - Daniel Tschinder
- Nykopol (nykopol)
- Rafał Muszyński (rafmus90) - Rafał Muszyński (rafmus90)
- Timothy Anido (xanido) - Timothy Anido (xanido)
- Rick Prent - Rick Prent
@ -1006,6 +1024,7 @@ Symfony is the result of the work of many people who made the code better
- Konrad Mohrfeldt - Konrad Mohrfeldt
- Lance Chen - Lance Chen
- Andrey Astakhov (aast) - Andrey Astakhov (aast)
- Nikolay Labinskiy (e-moe)
- kor3k kor3k (kor3k) - kor3k kor3k (kor3k)
- Stelian Mocanita (stelian) - Stelian Mocanita (stelian)
- Flavian (2much) - Flavian (2much)
@ -1015,6 +1034,7 @@ Symfony is the result of the work of many people who made the code better
- Hoffmann András - Hoffmann András
- Olivier - Olivier
- pscheit - pscheit
- Zdeněk Drahoš
- Dan Harper - Dan Harper
- moldcraft - moldcraft
- Ramon Kleiss (akathos) - Ramon Kleiss (akathos)
@ -1137,6 +1157,7 @@ Symfony is the result of the work of many people who made the code better
- Daan van Renterghem - Daan van Renterghem
- Nicole Cordes - Nicole Cordes
- Bram Van der Sype (brammm) - Bram Van der Sype (brammm)
- Guile (guile)
- Julien Moulin (lizjulien) - Julien Moulin (lizjulien)
- Nikita Nefedov (nikita2206) - Nikita Nefedov (nikita2206)
- Mauro Foti (skler) - Mauro Foti (skler)
@ -1209,7 +1230,6 @@ Symfony is the result of the work of many people who made the code better
- Haritz - Haritz
- Matthieu Prat - Matthieu Prat
- Grummfy - Grummfy
- Thomas Landauer
- Filipe Guerra - Filipe Guerra
- Gerben Wijnja - Gerben Wijnja
- Rowan Manning - Rowan Manning
@ -1260,6 +1280,7 @@ Symfony is the result of the work of many people who made the code better
- Muriel (metalmumu) - Muriel (metalmumu)
- Michael Pohlers (mick_the_big) - Michael Pohlers (mick_the_big)
- Cayetano Soriano Gallego (neoshadybeat) - Cayetano Soriano Gallego (neoshadybeat)
- Jean Pasdeloup (pasdeloup)
- Patrick McDougle (patrick-mcdougle) - Patrick McDougle (patrick-mcdougle)
- Pablo Monterde Perez (plebs) - Pablo Monterde Perez (plebs)
- Jimmy Leger (redpanda) - Jimmy Leger (redpanda)
@ -1298,7 +1319,6 @@ Symfony is the result of the work of many people who made the code better
- Mantas Urnieža - Mantas Urnieža
- Cas - Cas
- Dusan Kasan - Dusan Kasan
- Carson Full
- Myke79 - Myke79
- Brian Debuire - Brian Debuire
- Piers Warmers - Piers Warmers
@ -1332,6 +1352,7 @@ Symfony is the result of the work of many people who made the code better
- Andras Ratz - Andras Ratz
- andreabreu98 - andreabreu98
- Michael Schneider - Michael Schneider
- Cédric Bertolini
- n-aleha - n-aleha
- Şəhriyar İmanov - Şəhriyar İmanov
- Kaipi Yann - Kaipi Yann
@ -1358,6 +1379,7 @@ Symfony is the result of the work of many people who made the code better
- Jon Cave - Jon Cave
- Sébastien HOUZE - Sébastien HOUZE
- Abdulkadir N. A. - Abdulkadir N. A.
- Ivan Menshykov
- Yevgen Kovalienia - Yevgen Kovalienia
- Lebnik - Lebnik
- Sema - Sema
@ -1385,8 +1407,8 @@ Symfony is the result of the work of many people who made the code better
- Oncle Tom - Oncle Tom
- Christian Stocker - Christian Stocker
- Dawid Nowak - Dawid Nowak
- Richard Quadling
- Karolis Daužickas - Karolis Daužickas
- Sergio Santoro
- tirnanog06 - tirnanog06
- phc - phc
- Дмитрий Пацура - Дмитрий Пацура
@ -1412,7 +1434,6 @@ Symfony is the result of the work of many people who made the code better
- Loïc Vernet (coil) - Loïc Vernet (coil)
- Christoph Schaefer (cvschaefer) - Christoph Schaefer (cvschaefer)
- Damon Jones (damon__jones) - Damon Jones (damon__jones)
- David Badura (davidbadura)
- Daniel Londero (dlondero) - Daniel Londero (dlondero)
- Sebastian Landwehr (dword123) - Sebastian Landwehr (dword123)
- Adel ELHAIBA (eadel) - Adel ELHAIBA (eadel)
@ -1420,6 +1441,7 @@ Symfony is the result of the work of many people who made the code better
- Elliot Anderson (elliot) - Elliot Anderson (elliot)
- Sergey Zolotov (enleur) - Sergey Zolotov (enleur)
- Fabien D. (fabd) - Fabien D. (fabd)
- Carsten Eilers (fnc)
- Sorin Gitlan (forapathy) - Sorin Gitlan (forapathy)
- Yohan Giarelli (frequence-web) - Yohan Giarelli (frequence-web)
- Gerry Vandermaesen (gerryvdm) - Gerry Vandermaesen (gerryvdm)

View File

@ -546,6 +546,7 @@ abstract class FrameworkExtensionTest extends TestCase
/** /**
* @group legacy * @group legacy
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
*/ */
public function testDeprecatedSerializerCacheOption() public function testDeprecatedSerializerCacheOption()
{ {

View File

@ -86,6 +86,7 @@ class TemplateNameParserTest extends TestCase
/** /**
* @group legacy * @group legacy
* @dataProvider provideAbsolutePaths * @dataProvider provideAbsolutePaths
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
*/ */
public function testAbsolutePathsAreDeprecated($name, $logicalName, $path, $ref) public function testAbsolutePathsAreDeprecated($name, $logicalName, $path, $ref)
{ {

View File

@ -14,8 +14,6 @@ namespace Symfony\Component\Asset\Tests;
use Symfony\Component\Asset\Package; use Symfony\Component\Asset\Package;
use Symfony\Component\Asset\Packages; use Symfony\Component\Asset\Packages;
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy; use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
use Symfony\Component\Asset\Exception\InvalidArgumentException;
use Symfony\Component\Asset\Exception\LogicException;
class PackagesTest extends \PHPUnit_Framework_TestCase class PackagesTest extends \PHPUnit_Framework_TestCase
{ {
@ -57,7 +55,7 @@ class PackagesTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException LogicException * @expectedException \Symfony\Component\Asset\Exception\LogicException
*/ */
public function testNoDefaultPackage() public function testNoDefaultPackage()
{ {
@ -66,7 +64,7 @@ class PackagesTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @expectedException InvalidArgumentException * @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException
*/ */
public function testUndefinedPackage() public function testUndefinedPackage()
{ {

View File

@ -410,9 +410,16 @@ class SymfonyStyle extends OutputStyle
} }
} }
$firstLineIndex = 0;
if ($padding && $this->isDecorated()) {
$firstLineIndex = 1;
array_unshift($lines, '');
$lines[] = '';
}
foreach ($lines as $i => &$line) { foreach ($lines as $i => &$line) {
if (null !== $type) { if (null !== $type) {
$line = 0 === $i ? $type.$line : $lineIndentation.$line; $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line;
} }
$line = $prefix.$line; $line = $prefix.$line;
@ -423,11 +430,6 @@ class SymfonyStyle extends OutputStyle
} }
} }
if ($padding && $this->isDecorated()) {
array_unshift($lines, '');
$lines[] = '';
}
return $lines; return $lines;
} }
} }

View File

@ -0,0 +1,15 @@
<?php
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength;
// ensure that block() output is properly formatted (even padding lines)
return function (InputInterface $input, OutputInterface $output) {
$output->setDecorated(true);
$output = new SymfonyStyleWithForcedLineLength($input, $output);
$output->success(
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
'TEST'
);
};

View File

@ -0,0 +1,8 @@
 
 [OK] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore 
 magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 
 consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
 Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum 
 

View File

@ -58,6 +58,9 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
} }
} }
/**
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
*/
public function testCreateDeprecatedService() public function testCreateDeprecatedService()
{ {
ErrorAssert::assertDeprecationsAreTriggered('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', function () { ErrorAssert::assertDeprecationsAreTriggered('The "deprecated_foo" service is deprecated. You should stop using it, as it will soon be removed.', function () {

View File

@ -544,6 +544,7 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
/** /**
* @group legacy * @group legacy
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
*/ */
public function testAliasDefinitionContainsUnsupportedElements() public function testAliasDefinitionContainsUnsupportedElements()
{ {

View File

@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
class MongoDbSessionHandler implements \SessionHandlerInterface class MongoDbSessionHandler implements \SessionHandlerInterface
{ {
/** /**
* @var \Mongo * @var \Mongo|\MongoClient|\MongoDB\Client
*/ */
private $mongo; private $mongo;
@ -61,7 +61,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
* If you use such an index, you can drop `gc_probability` to 0 since * If you use such an index, you can drop `gc_probability` to 0 since
* no garbage-collection is required. * no garbage-collection is required.
* *
* @param \Mongo|\MongoClient $mongo A MongoClient or Mongo instance * @param \Mongo|\MongoClient|\MongoDB\Client $mongo A MongoDB\Client, MongoClient or Mongo instance
* @param array $options An associative array of field options * @param array $options An associative array of field options
* *
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided * @throws \InvalidArgumentException When MongoClient or Mongo instance not provided
@ -69,7 +69,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
*/ */
public function __construct($mongo, array $options) public function __construct($mongo, array $options)
{ {
if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo)) { if (!($mongo instanceof \MongoDB\Client || $mongo instanceof \MongoClient || $mongo instanceof \Mongo)) {
throw new \InvalidArgumentException('MongoClient or Mongo instance required'); throw new \InvalidArgumentException('MongoClient or Mongo instance required');
} }
@ -108,7 +108,9 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
*/ */
public function destroy($sessionId) public function destroy($sessionId)
{ {
$this->getCollection()->remove(array( $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
$this->getCollection()->$methodName(array(
$this->options['id_field'] => $sessionId, $this->options['id_field'] => $sessionId,
)); ));
@ -120,8 +122,10 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
*/ */
public function gc($maxlifetime) public function gc($maxlifetime)
{ {
$this->getCollection()->remove(array( $methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
$this->options['expiry_field'] => array('$lt' => new \MongoDate()),
$this->getCollection()->$methodName(array(
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),
)); ));
return true; return true;
@ -132,18 +136,28 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
*/ */
public function write($sessionId, $data) public function write($sessionId, $data)
{ {
$expiry = new \MongoDate(time() + (int) ini_get('session.gc_maxlifetime')); $expiry = $this->createDateTime(time() + (int) ini_get('session.gc_maxlifetime'));
$fields = array( $fields = array(
$this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY), $this->options['time_field'] => $this->createDateTime(),
$this->options['time_field'] => new \MongoDate(),
$this->options['expiry_field'] => $expiry, $this->options['expiry_field'] => $expiry,
); );
$this->getCollection()->update( $options = array('upsert' => true);
if ($this->mongo instanceof \MongoDB\Client) {
$fields[$this->options['data_field']] = new \MongoDB\BSON\Binary($data, \MongoDB\BSON\Binary::TYPE_OLD_BINARY);
} else {
$fields[$this->options['data_field']] = new \MongoBinData($data, \MongoBinData::BYTE_ARRAY);
$options['multiple'] = false;
}
$methodName = $this->mongo instanceof \MongoDB\Client ? 'updateOne' : 'update';
$this->getCollection()->$methodName(
array($this->options['id_field'] => $sessionId), array($this->options['id_field'] => $sessionId),
array('$set' => $fields), array('$set' => $fields),
array('upsert' => true, 'multiple' => false) $options
); );
return true; return true;
@ -156,10 +170,18 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
{ {
$dbData = $this->getCollection()->findOne(array( $dbData = $this->getCollection()->findOne(array(
$this->options['id_field'] => $sessionId, $this->options['id_field'] => $sessionId,
$this->options['expiry_field'] => array('$gte' => new \MongoDate()), $this->options['expiry_field'] => array('$gte' => $this->createDateTime()),
)); ));
return null === $dbData ? '' : $dbData[$this->options['data_field']]->bin; if (null === $dbData) {
return '';
}
if ($dbData[$this->options['data_field']] instanceof \MongoDB\BSON\Binary) {
return $dbData[$this->options['data_field']]->getData();
}
return $dbData[$this->options['data_field']]->bin;
} }
/** /**
@ -179,10 +201,30 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
/** /**
* Return a Mongo instance. * Return a Mongo instance.
* *
* @return \Mongo * @return \Mongo|\MongoClient|\MongoDB\Client
*/ */
protected function getMongo() protected function getMongo()
{ {
return $this->mongo; return $this->mongo;
} }
/**
* Create a date object using the class appropriate for the current mongo connection.
*
* Return an instance of a MongoDate or \MongoDB\BSON\UTCDateTime
*
* @param int $seconds An integer representing UTC seconds since Jan 1 1970. Defaults to now.
*/
private function createDateTime($seconds = null)
{
if (null === $seconds) {
$seconds = time();
}
if ($this->mongo instanceof \MongoDB\Client) {
return new \MongoDB\BSON\UTCDateTime($seconds * 1000);
}
return new \MongoDate($seconds);
}
} }

View File

@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandl
/** /**
* @author Markus Bachmann <markus.bachmann@bachi.biz> * @author Markus Bachmann <markus.bachmann@bachi.biz>
* @requires extension mongo
* @group time-sensitive * @group time-sensitive
*/ */
class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
@ -31,7 +30,15 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
{ {
parent::setUp(); parent::setUp();
if (!extension_loaded('mongo') && !extension_loaded('mongodb')) {
$this->markTestSkipped('The Mongo or MongoDB extension is required.');
}
if (phpversion('mongodb')) {
$mongoClass = 'MongoDB\Client';
} else {
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient'; $mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
}
$this->mongo = $this->getMockBuilder($mongoClass) $this->mongo = $this->getMockBuilder($mongoClass)
->disableOriginalConstructor() ->disableOriginalConstructor()
@ -96,14 +103,28 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$this->assertArrayHasKey($this->options['expiry_field'], $criteria); $this->assertArrayHasKey($this->options['expiry_field'], $criteria);
$this->assertArrayHasKey('$gte', $criteria[$this->options['expiry_field']]); $this->assertArrayHasKey('$gte', $criteria[$this->options['expiry_field']]);
if (phpversion('mongodb')) {
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$gte']);
$this->assertGreaterThanOrEqual(round(intval((string) $criteria[$this->options['expiry_field']]['$gte']) / 1000), $testTimeout);
} else {
$this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$gte']); $this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$gte']);
$this->assertGreaterThanOrEqual($criteria[$this->options['expiry_field']]['$gte']->sec, $testTimeout); $this->assertGreaterThanOrEqual($criteria[$this->options['expiry_field']]['$gte']->sec, $testTimeout);
}
return array( $fields = array(
$this->options['id_field'] => 'foo', $this->options['id_field'] => 'foo',
$this->options['data_field'] => new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY),
$this->options['id_field'] => new \MongoDate(),
); );
if (phpversion('mongodb')) {
$fields[$this->options['data_field']] = new \MongoDB\BSON\Binary('bar', \MongoDB\BSON\Binary::TYPE_OLD_BINARY);
$fields[$this->options['id_field']] = new \MongoDB\BSON\UTCDateTime(time() * 1000);
} else {
$fields[$this->options['data_field']] = new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY);
$fields[$this->options['id_field']] = new \MongoDate();
}
return $fields;
})); }));
$this->assertEquals('bar', $this->storage->read('foo')); $this->assertEquals('bar', $this->storage->read('foo'));
@ -120,11 +141,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$data = array(); $data = array();
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
$collection->expects($this->once()) $collection->expects($this->once())
->method('update') ->method($methodName)
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) { ->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
$this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria); $this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria);
if (phpversion('mongodb')) {
$this->assertEquals(array('upsert' => true), $options);
} else {
$this->assertEquals(array('upsert' => true, 'multiple' => false), $options); $this->assertEquals(array('upsert' => true, 'multiple' => false), $options);
}
$data = $updateData['$set']; $data = $updateData['$set'];
})); }));
@ -132,11 +160,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime'); $expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime');
$this->assertTrue($this->storage->write('foo', 'bar')); $this->assertTrue($this->storage->write('foo', 'bar'));
if (phpversion('mongodb')) {
$this->assertEquals('bar', $data[$this->options['data_field']]->getData());
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['time_field']]);
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['expiry_field']]);
$this->assertGreaterThanOrEqual($expectedExpiry, round(intval((string) $data[$this->options['expiry_field']]) / 1000));
} else {
$this->assertEquals('bar', $data[$this->options['data_field']]->bin); $this->assertEquals('bar', $data[$this->options['data_field']]->bin);
$this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); $this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
$this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]); $this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
$this->assertGreaterThanOrEqual($expectedExpiry, $data[$this->options['expiry_field']]->sec); $this->assertGreaterThanOrEqual($expectedExpiry, $data[$this->options['expiry_field']]->sec);
} }
}
public function testWriteWhenUsingExpiresField() public function testWriteWhenUsingExpiresField()
{ {
@ -160,21 +195,34 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$data = array(); $data = array();
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
$collection->expects($this->once()) $collection->expects($this->once())
->method('update') ->method($methodName)
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) { ->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
$this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria); $this->assertEquals(array($this->options['id_field'] => 'foo'), $criteria);
if (phpversion('mongodb')) {
$this->assertEquals(array('upsert' => true), $options);
} else {
$this->assertEquals(array('upsert' => true, 'multiple' => false), $options); $this->assertEquals(array('upsert' => true, 'multiple' => false), $options);
}
$data = $updateData['$set']; $data = $updateData['$set'];
})); }));
$this->assertTrue($this->storage->write('foo', 'bar')); $this->assertTrue($this->storage->write('foo', 'bar'));
if (phpversion('mongodb')) {
$this->assertEquals('bar', $data[$this->options['data_field']]->getData());
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['time_field']]);
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$this->options['expiry_field']]);
} else {
$this->assertEquals('bar', $data[$this->options['data_field']]->bin); $this->assertEquals('bar', $data[$this->options['data_field']]->bin);
$this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]); $this->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
$this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]); $this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
} }
}
public function testReplaceSessionData() public function testReplaceSessionData()
{ {
@ -187,8 +235,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$data = array(); $data = array();
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
$collection->expects($this->exactly(2)) $collection->expects($this->exactly(2))
->method('update') ->method($methodName)
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) { ->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
$data = $updateData; $data = $updateData;
})); }));
@ -196,8 +246,12 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$this->storage->write('foo', 'bar'); $this->storage->write('foo', 'bar');
$this->storage->write('foo', 'foobar'); $this->storage->write('foo', 'foobar');
if (phpversion('mongodb')) {
$this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->getData());
} else {
$this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin); $this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin);
} }
}
public function testDestroy() public function testDestroy()
{ {
@ -208,8 +262,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
->with($this->options['database'], $this->options['collection']) ->with($this->options['database'], $this->options['collection'])
->will($this->returnValue($collection)); ->will($this->returnValue($collection));
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
$collection->expects($this->once()) $collection->expects($this->once())
->method('remove') ->method($methodName)
->with(array($this->options['id_field'] => 'foo')); ->with(array($this->options['id_field'] => 'foo'));
$this->assertTrue($this->storage->destroy('foo')); $this->assertTrue($this->storage->destroy('foo'));
@ -224,11 +280,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
->with($this->options['database'], $this->options['collection']) ->with($this->options['database'], $this->options['collection'])
->will($this->returnValue($collection)); ->will($this->returnValue($collection));
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
$collection->expects($this->once()) $collection->expects($this->once())
->method('remove') ->method($methodName)
->will($this->returnCallback(function ($criteria) { ->will($this->returnCallback(function ($criteria) {
if (phpversion('mongodb')) {
$this->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$this->options['expiry_field']]['$lt']);
$this->assertGreaterThanOrEqual(time() - 1, round(intval((string) $criteria[$this->options['expiry_field']]['$lt']) / 1000));
} else {
$this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$lt']); $this->assertInstanceOf('MongoDate', $criteria[$this->options['expiry_field']]['$lt']);
$this->assertGreaterThanOrEqual(time() - 1, $criteria[$this->options['expiry_field']]['$lt']->sec); $this->assertGreaterThanOrEqual(time() - 1, $criteria[$this->options['expiry_field']]['$lt']->sec);
}
})); }));
$this->assertTrue($this->storage->gc(1)); $this->assertTrue($this->storage->gc(1));
@ -239,14 +302,23 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
$method = new \ReflectionMethod($this->storage, 'getMongo'); $method = new \ReflectionMethod($this->storage, 'getMongo');
$method->setAccessible(true); $method->setAccessible(true);
$mongoClass = (version_compare(phpversion('mongo'), '1.3.0', '<')) ? '\Mongo' : '\MongoClient'; if (phpversion('mongodb')) {
$mongoClass = 'MongoDB\Client';
} else {
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
}
$this->assertInstanceOf($mongoClass, $method->invoke($this->storage)); $this->assertInstanceOf($mongoClass, $method->invoke($this->storage));
} }
private function createMongoCollectionMock() private function createMongoCollectionMock()
{ {
$collection = $this->getMockBuilder('MongoCollection') $collectionClass = 'MongoCollection';
if (phpversion('mongodb')) {
$collectionClass = 'MongoDB\Collection';
}
$collection = $this->getMockBuilder($collectionClass)
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();

View File

@ -28,6 +28,7 @@ class EsiFragmentRendererTest extends \PHPUnit_Framework_TestCase
/** /**
* @group legacy * @group legacy
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
*/ */
public function testRenderFallbackWithObjectAttributesIsDeprecated() public function testRenderFallbackWithObjectAttributesIsDeprecated()
{ {

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\Security\Guard\Authenticator; namespace Symfony\Component\Security\Guard\Authenticator;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Guard\AbstractGuardAuthenticator; use Symfony\Component\Security\Guard\AbstractGuardAuthenticator;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -45,7 +46,10 @@ abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator
*/ */
public function onAuthenticationFailure(Request $request, AuthenticationException $exception) public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{ {
if ($request->getSession() instanceof SessionInterface) {
$request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception); $request->getSession()->set(Security::AUTHENTICATION_ERROR, $exception);
}
$url = $this->getLoginUrl(); $url = $this->getLoginUrl();
return new RedirectResponse($url); return new RedirectResponse($url);
@ -65,12 +69,16 @@ abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator
@trigger_error(sprintf('The AbstractFormLoginAuthenticator::onAuthenticationSuccess() implementation was deprecated in Symfony 3.1 and will be removed in Symfony 4.0. You should implement this method yourself in %s and remove getDefaultSuccessRedirectUrl().', get_class($this)), E_USER_DEPRECATED); @trigger_error(sprintf('The AbstractFormLoginAuthenticator::onAuthenticationSuccess() implementation was deprecated in Symfony 3.1 and will be removed in Symfony 4.0. You should implement this method yourself in %s and remove getDefaultSuccessRedirectUrl().', get_class($this)), E_USER_DEPRECATED);
if (!method_exists($this, 'getDefaultSuccessRedirectUrl')) { if (!method_exists($this, 'getDefaultSuccessRedirectUrl')) {
throw new \Exception(sprintf('You must implement onAuthenticationSuccess() or getDefaultSuccessRedirectURL() in %s.', get_class($this))); throw new \Exception(sprintf('You must implement onAuthenticationSuccess() or getDefaultSuccessRedirectUrl() in %s.', get_class($this)));
} }
// if the user hits a secure page and start() was called, this was $targetPath = null;
// if the user hit a secure page and start() was called, this was
// the URL they were on, and probably where you want to redirect to // the URL they were on, and probably where you want to redirect to
if ($request->getSession() instanceof SessionInterface) {
$targetPath = $this->getTargetPath($request->getSession(), $providerKey); $targetPath = $this->getTargetPath($request->getSession(), $providerKey);
}
if (!$targetPath) { if (!$targetPath) {
$targetPath = $this->getDefaultSuccessRedirectUrl(); $targetPath = $this->getDefaultSuccessRedirectUrl();

View File

@ -1,64 +0,0 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Guard\Tests\Authenticator;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator;
class AbstractFormLoginAuthenticatorTest extends \PHPUnit_Framework_TestCase
{
/**
* @group legacy
*/
public function testLegacyWithLoginUrl()
{
$request = new Request();
$request->setSession($this->getMock('Symfony\Component\HttpFoundation\Session\Session'));
$authenticator = new LegacyFormLoginAuthenticator();
/** @var RedirectResponse $actualResponse */
$actualResponse = $authenticator->onAuthenticationSuccess(
$request,
$this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'),
'provider_key'
);
$this->assertEquals('/default_url', $actualResponse->getTargetUrl());
}
}
class LegacyFormLoginAuthenticator extends AbstractFormLoginAuthenticator
{
protected function getDefaultSuccessRedirectUrl()
{
return '/default_url';
}
protected function getLoginUrl()
{
}
public function getCredentials(Request $request)
{
}
public function getUser($credentials, UserProviderInterface $userProvider)
{
}
public function checkCredentials($credentials, UserInterface $user)
{
}
}

View File

@ -0,0 +1,221 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Security\Guard\Tests\Authenticator;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Guard\Authenticator\AbstractFormLoginAuthenticator;
/**
* @author Jean Pasdeloup <jpasdeloup@sedona.fr>
*/
class FormLoginAuthenticatorTest extends \PHPUnit_Framework_TestCase
{
private $requestWithoutSession;
private $requestWithSession;
private $authenticator;
const LOGIN_URL = 'http://login';
const DEFAULT_SUCCESS_URL = 'http://defaultsuccess';
const CUSTOM_SUCCESS_URL = 'http://customsuccess';
public function testAuthenticationFailureWithoutSession()
{
$failureResponse = $this->authenticator->onAuthenticationFailure($this->requestWithoutSession, new AuthenticationException());
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse);
$this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl());
}
public function testAuthenticationFailureWithSession()
{
$this->requestWithSession->getSession()
->expects($this->once())
->method('set');
$failureResponse = $this->authenticator->onAuthenticationFailure($this->requestWithSession, new AuthenticationException());
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse);
$this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl());
}
/**
* @group legacy
*/
public function testAuthenticationSuccessWithoutSession()
{
$token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')
->disableOriginalConstructor()
->getMock();
$redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithoutSession, $token, 'providerkey');
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse);
$this->assertEquals(self::DEFAULT_SUCCESS_URL, $redirectResponse->getTargetUrl());
}
/**
* @group legacy
*/
public function testAuthenticationSuccessWithSessionButEmpty()
{
$token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')
->disableOriginalConstructor()
->getMock();
$this->requestWithSession->getSession()
->expects($this->once())
->method('get')
->will($this->returnValue(null));
$redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithSession, $token, 'providerkey');
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse);
$this->assertEquals(self::DEFAULT_SUCCESS_URL, $redirectResponse->getTargetUrl());
}
/**
* @group legacy
*/
public function testAuthenticationSuccessWithSessionAndTarget()
{
$token = $this->getMockBuilder('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface')
->disableOriginalConstructor()
->getMock();
$this->requestWithSession->getSession()
->expects($this->once())
->method('get')
->will($this->returnValue(self::CUSTOM_SUCCESS_URL));
$redirectResponse = $this->authenticator->onAuthenticationSuccess($this->requestWithSession, $token, 'providerkey');
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $redirectResponse);
$this->assertEquals(self::CUSTOM_SUCCESS_URL, $redirectResponse->getTargetUrl());
}
public function testRememberMe()
{
$doSupport = $this->authenticator->supportsRememberMe();
$this->assertTrue($doSupport);
}
public function testStartWithoutSession()
{
$failureResponse = $this->authenticator->start($this->requestWithoutSession, new AuthenticationException());
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse);
$this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl());
}
public function testStartWithSession()
{
$failureResponse = $this->authenticator->start($this->requestWithSession, new AuthenticationException());
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\RedirectResponse', $failureResponse);
$this->assertEquals(self::LOGIN_URL, $failureResponse->getTargetUrl());
}
protected function setUp()
{
$this->requestWithoutSession = new Request(array(), array(), array(), array(), array(), array());
$this->requestWithSession = new Request(array(), array(), array(), array(), array(), array());
$session = $this->getMockBuilder('Symfony\\Component\\HttpFoundation\\Session\\SessionInterface')
->disableOriginalConstructor()
->getMock();
$this->requestWithSession->setSession($session);
$this->authenticator = new TestFormLoginAuthenticator();
$this->authenticator
->setLoginUrl(self::LOGIN_URL)
->setDefaultSuccessRedirectUrl(self::DEFAULT_SUCCESS_URL)
;
}
protected function tearDown()
{
$this->request = null;
$this->requestWithSession = null;
}
}
class TestFormLoginAuthenticator extends AbstractFormLoginAuthenticator
{
private $loginUrl;
private $defaultSuccessRedirectUrl;
/**
* @param mixed $defaultSuccessRedirectUrl
*
* @return TestFormLoginAuthenticator
*/
public function setDefaultSuccessRedirectUrl($defaultSuccessRedirectUrl)
{
$this->defaultSuccessRedirectUrl = $defaultSuccessRedirectUrl;
return $this;
}
/**
* @param mixed $loginUrl
*
* @return TestFormLoginAuthenticator
*/
public function setLoginUrl($loginUrl)
{
$this->loginUrl = $loginUrl;
return $this;
}
/**
* {@inheritdoc}
*/
protected function getLoginUrl()
{
return $this->loginUrl;
}
/**
* {@inheritdoc}
*/
protected function getDefaultSuccessRedirectUrl()
{
return $this->defaultSuccessRedirectUrl;
}
/**
* {@inheritdoc}
*/
public function getCredentials(Request $request)
{
return 'credentials';
}
/**
* {@inheritdoc}
*/
public function getUser($credentials, UserProviderInterface $userProvider)
{
return $userProvider->loadUserByUsername($credentials);
}
/**
* {@inheritdoc}
*/
public function checkCredentials($credentials, UserInterface $user)
{
return true;
}
}

View File

@ -255,6 +255,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase
/** /**
* @group legacy * @group legacy
* @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered
* throws \Symfony\Component\Yaml\Exception\ParseException in 4.0 * throws \Symfony\Component\Yaml\Exception\ParseException in 4.0
*/ */
public function testParseUnquotedScalarStartingWithPercentCharacter() public function testParseUnquotedScalarStartingWithPercentCharacter()