Merge branch '2.7' into 2.8
* 2.7: [travis] Fix deps=low/high builds fixed CS Fix for #19183 to add support for new PHP MongoDB extension in sessions. 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 Fixed typos in the expectedException annotations Conflicts: src/Symfony/Component/HttpKernel/Kernel.php
This commit is contained in:
commit
fe17083cf9
4
.github/travis.php
vendored
4
.github/travis.php
vendored
@ -46,8 +46,8 @@ foreach ($dirs as $dir) {
|
||||
$versions = file_get_contents('https://packagist.org/packages/'.$package->name.'.json');
|
||||
$versions = json_decode($versions);
|
||||
|
||||
foreach ($versions->package->versions as $version => $package) {
|
||||
$packages[$package->name] += array($version => $package);
|
||||
foreach ($versions->package->versions as $v => $package) {
|
||||
$packages[$package->name] += array($v => $package);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,36 @@ 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.15 (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 #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 #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)
|
||||
|
||||
* 2.7.14 (2016-06-06)
|
||||
|
||||
* bug #18908 [DependencyInjection] force enabling the external XML entity loaders (xabbuh)
|
||||
|
@ -8,8 +8,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Nicolas Grekas (nicolas-grekas)
|
||||
- Bernhard Schussek (bschussek)
|
||||
- Tobias Schultze (tobion)
|
||||
- Christophe Coevoet (stof)
|
||||
- Christian Flothmann (xabbuh)
|
||||
- Christophe Coevoet (stof)
|
||||
- Jordi Boggiano (seldaek)
|
||||
- Victor Berchet (victor)
|
||||
- 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)
|
||||
- Ryan Weaver (weaverryan)
|
||||
- Javier Eguiluz (javier.eguiluz)
|
||||
- Hugo Hamon (hhamon)
|
||||
- Kévin Dunglas (dunglas)
|
||||
- Hugo Hamon (hhamon)
|
||||
- Abdellatif Ait boudad (aitboudad)
|
||||
- Pascal Borreli (pborreli)
|
||||
- Joseph Bielawski (stloyd)
|
||||
- Wouter De Jong (wouterj)
|
||||
- Joseph Bielawski (stloyd)
|
||||
- Romain Neutron (romain)
|
||||
- Karma Dordrak (drak)
|
||||
- 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)
|
||||
- Eriksen Costa (eriksencosta)
|
||||
- Sarah Khalil (saro0h)
|
||||
- Jules Pietri (heah)
|
||||
- Jonathan Wage (jwage)
|
||||
- Diego Saint Esteben (dosten)
|
||||
- Maxime Steinhausser (ogizanagi)
|
||||
- Diego Saint Esteben (dosten)
|
||||
- Alexandre Salomé (alexandresalome)
|
||||
- William Durand (couac)
|
||||
- Jules Pietri (heah)
|
||||
- ornicar
|
||||
- Francis Besset (francisbesset)
|
||||
- stealth35 (stealth35)
|
||||
- Alexander Mols (asm89)
|
||||
- Francis Besset (francisbesset)
|
||||
- Bulat Shakirzyanov (avalanche123)
|
||||
- Saša Stamenković (umpirsky)
|
||||
- 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)
|
||||
- Bilal Amarni (bamarni)
|
||||
- Florin Patan (florinpatan)
|
||||
- Kevin Bond (kbond)
|
||||
- Peter Rehm (rpet)
|
||||
- Kevin Bond (kbond)
|
||||
- Gábor Egyed (1ed)
|
||||
- Ener-Getick (energetick)
|
||||
- Michel Weimerskirch (mweimerskirch)
|
||||
- Eric Clemmons (ericclemmons)
|
||||
- Iltar van der Berg (kjarli)
|
||||
- Andrej Hudec (pulzarraider)
|
||||
- Christian Raue
|
||||
- Charles Sarrazin (csarrazi)
|
||||
- Matthias Pigulla (mpdude)
|
||||
- Deni
|
||||
- Henrik Westphal (snc)
|
||||
- Dariusz Górecki (canni)
|
||||
- Arnout Boks (aboks)
|
||||
- Iltar van der Berg (kjarli)
|
||||
- Charles Sarrazin (csarrazi)
|
||||
- Ener-Getick (energetick)
|
||||
- Douglas Greenshields (shieldo)
|
||||
- Lee McDermott
|
||||
- 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)
|
||||
- Arnaud Le Blanc (arnaud-lb)
|
||||
- Jérôme Tamarelle (gromnan)
|
||||
- Paráda József (paradajozsef)
|
||||
- Michal Piotrowski (eventhorizon)
|
||||
- Tim Nagel (merk)
|
||||
- Paráda József (paradajozsef)
|
||||
- Brice BERNARD (brikou)
|
||||
- Robin Chalas (chalas_r)
|
||||
- Alexander M. Turek (derrabus)
|
||||
- Dariusz Ruminski
|
||||
- marc.weistroff
|
||||
- Issei Murasawa (issei_m)
|
||||
- lenar
|
||||
- Włodzimierz Gajda (gajdaw)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Baptiste Clavié (talus)
|
||||
- Alexander Schwenn (xelaris)
|
||||
- Florian Voutzinos (florianv)
|
||||
- Konstantin Myakshin (koc)
|
||||
- Colin Frei
|
||||
- Adrien Brault (adrienbrault)
|
||||
- Joshua Thijssen
|
||||
- Baptiste Clavié (talus)
|
||||
- Peter Kokot (maastermedia)
|
||||
- excelwebzone
|
||||
- Jacob Dreesen (jdreesen)
|
||||
- Jáchym Toušek (enumag)
|
||||
- Jérémy DERUSSÉ (jderusse)
|
||||
- Vladimir Reznichenko (kalessil)
|
||||
- Tomáš Votruba (tomas_votruba)
|
||||
- Fabien Pennequin (fabienpennequin)
|
||||
- Gordon Franke (gimler)
|
||||
- Eric GELOEN (gelo)
|
||||
- David Buchmann (dbu)
|
||||
- Tomáš Votruba (tomas_votruba)
|
||||
- Jáchym Toušek
|
||||
- Robert Schönthal (digitalkaoz)
|
||||
- Florian Lonqueu-Brochard (florianlb)
|
||||
- Eric GELOEN (gelo)
|
||||
- Stefano Sala (stefano.sala)
|
||||
- Juti Noppornpitak (shiroyuki)
|
||||
- Titouan Galopin (tgalopin)
|
||||
- Tigran Azatyan (tigranazatyan)
|
||||
- Sebastian Hörl (blogsh)
|
||||
- Daniel Gomes (danielcsgomes)
|
||||
- Hidenori Goto (hidenorigoto)
|
||||
- Sebastiaan Stok (sstok)
|
||||
- Evgeniy (ewgraf)
|
||||
- Tugdual Saunier (tucksaun)
|
||||
- Guilherme Blanco (guilhermeblanco)
|
||||
- Pablo Godel (pgodel)
|
||||
- Titouan Galopin (tgalopin)
|
||||
- Jérémie Augustin (jaugustin)
|
||||
- Sebastiaan Stok (sstok)
|
||||
- Tugdual Saunier (tucksaun)
|
||||
- Andréia Bohner (andreia)
|
||||
- Rafael Dohms (rdohms)
|
||||
- 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)
|
||||
- Matthieu Ouellette-Vachon (maoueh)
|
||||
- Michał Pipa (michal.pipa)
|
||||
- Javier Spagnoletti (phansys)
|
||||
- Amal Raghav (kertz)
|
||||
- Jonathan Ingram (jonathaningram)
|
||||
- Artur Kotyrba
|
||||
@ -150,7 +152,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Daniel Wehner
|
||||
- Possum
|
||||
- Dorian Villet (gnutix)
|
||||
- Javier Spagnoletti (phansys)
|
||||
- Richard Miller (mr_r_miller)
|
||||
- Mario A. Alvarez Garcia (nomack84)
|
||||
- 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)
|
||||
- Lars Strojny (lstrojny)
|
||||
- Rui Marinho (ruimarinho)
|
||||
- Daniel Espendiller
|
||||
- Eugene Wissner
|
||||
- Julien Brochet (mewt)
|
||||
- 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)
|
||||
- Dawid Nowak
|
||||
- Pierre-Yves LEBECQ (pylebecq)
|
||||
- Daniel Espendiller
|
||||
- Jakub Kucharovic (jkucharovic)
|
||||
- Robin Chalas (chalas_r)
|
||||
- Eugene Leonovich (rybakit)
|
||||
- Filippo Tessarotto
|
||||
- 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)
|
||||
- Antonio J. García Lagar (ajgarlag)
|
||||
- Kim Hemsø Rasmussen (kimhemsoe)
|
||||
- Christian Schmidt
|
||||
- Wouter Van Hecke
|
||||
- Peter Kruithof (pkruithof)
|
||||
- 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)
|
||||
- Chris Smith (cs278)
|
||||
- Florian Klein (docteurklein)
|
||||
- Oleg Voronkovich
|
||||
- Manuel Kiessling (manuelkiessling)
|
||||
- Daniel Wehner
|
||||
- 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)
|
||||
- Christian Gärtner (dagardner)
|
||||
- Tomasz Kowalczyk (thunderer)
|
||||
- Christian Schmidt
|
||||
- François-Xavier de Guillebon (de-gui_f)
|
||||
- Damien Alexandre (damienalexandre)
|
||||
- Felix Labrecque
|
||||
@ -322,6 +323,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Endre Fejes
|
||||
- Tobias Naumann (tna)
|
||||
- Daniel Beyer
|
||||
- Jhonny Lidfors (jhonne)
|
||||
- Shein Alexey
|
||||
- Baptiste Lafontaine
|
||||
- Joe Lencioni
|
||||
@ -335,7 +337,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Ivan Kurnosov
|
||||
- Xavier HAUSHERR
|
||||
- Albert Jessurum (ajessu)
|
||||
- Oleg Voronkovich
|
||||
- Laszlo Korte
|
||||
- Pavel Batanov (scaytrase)
|
||||
- Miha Vrhovnik
|
||||
@ -355,6 +356,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Brian King
|
||||
- Michel Salib (michelsalib)
|
||||
- geoffrey
|
||||
- Steffen Roßkamp
|
||||
- Valentin Jonovs (valentins-jonovs)
|
||||
- Jeanmonod David (jeanmonod)
|
||||
- Jan Schumann
|
||||
@ -364,6 +366,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Mihai Stancu
|
||||
- Olivier Dolbeau (odolbeau)
|
||||
- Jan Rosier (rosier)
|
||||
- Magnus Nordlander (magnusnordlander)
|
||||
- vagrant
|
||||
- EdgarPE
|
||||
- Florian Pfitzer (marmelatze)
|
||||
@ -379,6 +382,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Christian Schmidt
|
||||
- Marek Štípek (maryo)
|
||||
- Marcin Sikoń (marphi)
|
||||
- Roland Franssen (ro0)
|
||||
- Dominik Zogg (dominik.zogg)
|
||||
- Marek Pietrzak
|
||||
- Chad Sikorra (chadsikorra)
|
||||
@ -390,6 +394,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Zander Baldwin
|
||||
- Adam Harvey
|
||||
- Alex Bakhturin
|
||||
- Alexander Obuhovich (aik099)
|
||||
- boombatower
|
||||
- Fabrice Bernhard (fabriceb)
|
||||
- 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
|
||||
- Barry vd. Heuvel (barryvdh)
|
||||
- Jerzy Zawadzki (jzawadzki)
|
||||
- Théo FIDRY (theofidry)
|
||||
- Evan S Kaufman (evanskaufman)
|
||||
- mcben
|
||||
- Jérôme Vieilledent (lolautruche)
|
||||
- Maks Slesarenko
|
||||
- Filip Procházka (fprochazka)
|
||||
- mmoreram
|
||||
- Markus Lanthaler (lanthaler)
|
||||
- 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)
|
||||
- Nate (frickenate)
|
||||
- jhonnyL
|
||||
- Jhonny Lidfors (jhonne)
|
||||
- sasezaki
|
||||
- Dawid Pakuła (zulusx)
|
||||
- Florian Rey (nervo)
|
||||
@ -503,6 +509,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Maxime Douailin
|
||||
- Javier López (loalf)
|
||||
- Reinier Kip
|
||||
- Geoffrey Brier (geoffrey-brier)
|
||||
- Dustin Dobervich (dustin10)
|
||||
- dantleech
|
||||
- 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
|
||||
- Sascha Grossenbacher
|
||||
- Szijarto Tamas
|
||||
- David Badura (davidbadura)
|
||||
- Catalin Dan
|
||||
- Stephan Vock
|
||||
- Benjamin Zikarsky (bzikarsky)
|
||||
- Anton Bakai
|
||||
- Simon Schick (simonsimcity)
|
||||
- redstar504
|
||||
- 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)
|
||||
- develop
|
||||
- Mark Sonnabaum
|
||||
- Alexander Obuhovich (aik099)
|
||||
- Richard Quadling
|
||||
- jochenvdv
|
||||
- Arturas Smorgun (asarturas)
|
||||
- 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)
|
||||
- Vladyslav Petrovych
|
||||
- Alex Xandra Albert Sim
|
||||
- Carson Full
|
||||
- Trent Steel (trsteel88)
|
||||
- Yuen-Chi Lian
|
||||
- Besnik Br
|
||||
@ -589,6 +599,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Leevi Graham (leevigraham)
|
||||
- Casper Valdemar Poulsen
|
||||
- Josiah (josiah)
|
||||
- Joschi Kuphal
|
||||
- John Bohn (jbohn)
|
||||
- Marc Morera (mmoreram)
|
||||
- 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)
|
||||
- James Michael DuPont
|
||||
- Tom Klingenberg
|
||||
- Filip Procházka (fprochazka)
|
||||
- Christopher Hall (mythmakr)
|
||||
- Paul Kamer (pkamer)
|
||||
- Rafał Wrzeszcz (rafalwrzeszcz)
|
||||
@ -637,7 +647,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Neil Ferreira
|
||||
- Nathanael Noblet (gnat)
|
||||
- Dmitry Parnas (parnas)
|
||||
- Théo FIDRY (theofidry)
|
||||
- Paul LE CORRE
|
||||
- DQNEO
|
||||
- Emanuele Iannone
|
||||
@ -652,7 +661,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Matt Robinson (inanimatt)
|
||||
- Aleksey Podskrebyshev
|
||||
- Calin Mihai Pristavu
|
||||
- Steffen Roßkamp
|
||||
- David Marín Carreño (davefx)
|
||||
- Jörn Lang (j.lang)
|
||||
- Omar Yepez (oyepez003)
|
||||
@ -677,6 +685,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Don Pinkster
|
||||
- Maksim Muruev
|
||||
- Emil Einarsson
|
||||
- Thomas Landauer
|
||||
- Thibault Duplessis
|
||||
- Marc Abramowitz
|
||||
- Martijn Evers
|
||||
@ -697,7 +706,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- David Lima
|
||||
- Jérôme Vasseur
|
||||
- Brunet Laurent (lbrunet)
|
||||
- Magnus Nordlander (magnusnordlander)
|
||||
- Mikhail Yurasov (mym)
|
||||
- LOUARDI Abdeltif (ouardisoft)
|
||||
- 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)
|
||||
- sensio
|
||||
- Patrick Kaufmann
|
||||
- Piotr Stankowski
|
||||
- Reece Fowell (reecefowell)
|
||||
- Mátyás Somfai (smatyas)
|
||||
- stefan.r
|
||||
@ -728,6 +737,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Pieter
|
||||
- Michael Tibben
|
||||
- Sander Marechal
|
||||
- Andre Rømcke (andrerom)
|
||||
- Radosław Benkel
|
||||
- ttomor
|
||||
- Mei Gwilym (meigwilym)
|
||||
@ -743,6 +753,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Danilo Silva
|
||||
- Zachary Tong (polyfractal)
|
||||
- Hryhorii Hrebiniuk
|
||||
- Dennis Fridrich (dfridrich)
|
||||
- mcfedr (mcfedr)
|
||||
- hamza
|
||||
- dantleech
|
||||
@ -752,6 +763,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Guillaume Royer
|
||||
- Artem (digi)
|
||||
- boite
|
||||
- MGDSoft
|
||||
- Vadim Tyukov (vatson)
|
||||
- Sortex
|
||||
- chispita
|
||||
@ -804,10 +816,12 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Benoit Garret
|
||||
- Thomas Royer (cydonia7)
|
||||
- DerManoMann
|
||||
- Olaf Klischat
|
||||
- Jhonny Lidfors (jhonny)
|
||||
- Julien Bianchi (jubianchi)
|
||||
- Robert Meijers
|
||||
- Marcin Chwedziak
|
||||
- Roland Franssen (ro0)
|
||||
- hjkl
|
||||
- Tony Cosentino (tony-co)
|
||||
- Rodrigo Díez Villamuera (rodrigodiez)
|
||||
- e-ivanov
|
||||
@ -815,6 +829,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Jeremy Bush
|
||||
- wizhippo
|
||||
- Viacheslav Sychov
|
||||
- Carlos Ortega Huetos
|
||||
- rpg600
|
||||
- Péter Buri (burci)
|
||||
- Davide Borsatto (davide.borsatto)
|
||||
@ -834,6 +849,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- spdionis
|
||||
- Eduardo García Sanz (coma)
|
||||
- James Gilliland
|
||||
- Rhodri Pugh (rodnaph)
|
||||
- David de Boer (ddeboer)
|
||||
- Gilles Doge (gido)
|
||||
- abulford
|
||||
@ -855,7 +871,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Juan Traverso
|
||||
- Philipp Strube
|
||||
- Christian Sciberras
|
||||
- Anton Bakai
|
||||
- Clement Herreman (clemherreman)
|
||||
- Dan Ionut Dumitriu (danionut90)
|
||||
- Nyro (nyro)
|
||||
@ -893,7 +908,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- azine
|
||||
- Dawid Sajdak
|
||||
- Ludek Stepan
|
||||
- Geoffrey Brier
|
||||
- Aaron Stephens (astephens)
|
||||
- Craig Menning (cmenning)
|
||||
- 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)
|
||||
- Samuel Vogel (samuelvogel)
|
||||
- Berat Doğan
|
||||
- Juanmi Rodriguez Cerón
|
||||
- Anthony Ferrara
|
||||
- Klaas Cuvelier (kcuvelier)
|
||||
- Steve Frécinaux
|
||||
@ -934,6 +949,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Philip Frank
|
||||
- Lance McNearney
|
||||
- Giorgio Premi
|
||||
- Ian Carroll
|
||||
- caponica
|
||||
- Matt Daum (daum)
|
||||
- Alberto Pirovano (geezmo)
|
||||
@ -945,6 +961,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Max Summe
|
||||
- WedgeSama
|
||||
- Felds Liscia
|
||||
- Ahmed TAILOULOUTE (ahmedtai)
|
||||
- James Halsall (jaitsu)
|
||||
- Maxime Veber (nek-)
|
||||
- Sullivan SENECHAL
|
||||
@ -968,6 +985,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Max Romanovsky (maxromanovsky)
|
||||
- Mathieu Morlon
|
||||
- Daniel Tschinder
|
||||
- Nykopol (nykopol)
|
||||
- Rafał Muszyński (rafmus90)
|
||||
- Timothy Anido (xanido)
|
||||
- Rick Prent
|
||||
@ -1006,6 +1024,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Konrad Mohrfeldt
|
||||
- Lance Chen
|
||||
- Andrey Astakhov (aast)
|
||||
- Nikolay Labinskiy (e-moe)
|
||||
- kor3k kor3k (kor3k)
|
||||
- Stelian Mocanita (stelian)
|
||||
- Flavian (2much)
|
||||
@ -1015,6 +1034,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Hoffmann András
|
||||
- Olivier
|
||||
- pscheit
|
||||
- Zdeněk Drahoš
|
||||
- Dan Harper
|
||||
- moldcraft
|
||||
- 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
|
||||
- Nicole Cordes
|
||||
- Bram Van der Sype (brammm)
|
||||
- Guile (guile)
|
||||
- Julien Moulin (lizjulien)
|
||||
- Nikita Nefedov (nikita2206)
|
||||
- Mauro Foti (skler)
|
||||
@ -1209,7 +1230,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Haritz
|
||||
- Matthieu Prat
|
||||
- Grummfy
|
||||
- Thomas Landauer
|
||||
- Filipe Guerra
|
||||
- Gerben Wijnja
|
||||
- Rowan Manning
|
||||
@ -1260,6 +1280,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Muriel (metalmumu)
|
||||
- Michael Pohlers (mick_the_big)
|
||||
- Cayetano Soriano Gallego (neoshadybeat)
|
||||
- Jean Pasdeloup (pasdeloup)
|
||||
- Patrick McDougle (patrick-mcdougle)
|
||||
- Pablo Monterde Perez (plebs)
|
||||
- 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
|
||||
- Cas
|
||||
- Dusan Kasan
|
||||
- Carson Full
|
||||
- Myke79
|
||||
- Brian Debuire
|
||||
- Piers Warmers
|
||||
@ -1332,6 +1352,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Andras Ratz
|
||||
- andreabreu98
|
||||
- Michael Schneider
|
||||
- Cédric Bertolini
|
||||
- n-aleha
|
||||
- Şəhriyar İmanov
|
||||
- Kaipi Yann
|
||||
@ -1358,6 +1379,7 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Jon Cave
|
||||
- Sébastien HOUZE
|
||||
- Abdulkadir N. A.
|
||||
- Ivan Menshykov
|
||||
- Yevgen Kovalienia
|
||||
- Lebnik
|
||||
- Sema
|
||||
@ -1385,8 +1407,8 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Oncle Tom
|
||||
- Christian Stocker
|
||||
- Dawid Nowak
|
||||
- Richard Quadling
|
||||
- Karolis Daužickas
|
||||
- Sergio Santoro
|
||||
- tirnanog06
|
||||
- phc
|
||||
- Дмитрий Пацура
|
||||
@ -1412,7 +1434,6 @@ Symfony is the result of the work of many people who made the code better
|
||||
- Loïc Vernet (coil)
|
||||
- Christoph Schaefer (cvschaefer)
|
||||
- Damon Jones (damon__jones)
|
||||
- David Badura (davidbadura)
|
||||
- Daniel Londero (dlondero)
|
||||
- Sebastian Landwehr (dword123)
|
||||
- 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)
|
||||
- Sergey Zolotov (enleur)
|
||||
- Fabien D. (fabd)
|
||||
- Carsten Eilers (fnc)
|
||||
- Sorin Gitlan (forapathy)
|
||||
- Yohan Giarelli (frequence-web)
|
||||
- Gerry Vandermaesen (gerryvdm)
|
||||
|
@ -14,8 +14,6 @@ namespace Symfony\Component\Asset\Tests;
|
||||
use Symfony\Component\Asset\Package;
|
||||
use Symfony\Component\Asset\Packages;
|
||||
use Symfony\Component\Asset\VersionStrategy\StaticVersionStrategy;
|
||||
use Symfony\Component\Asset\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Asset\Exception\LogicException;
|
||||
|
||||
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()
|
||||
{
|
||||
@ -66,7 +64,7 @@ class PackagesTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException InvalidArgumentException
|
||||
* @expectedException \Symfony\Component\Asset\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testUndefinedPackage()
|
||||
{
|
||||
|
@ -19,7 +19,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
|
||||
class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
{
|
||||
/**
|
||||
* @var \Mongo
|
||||
* @var \Mongo|\MongoClient|\MongoDB\Client
|
||||
*/
|
||||
private $mongo;
|
||||
|
||||
@ -61,15 +61,15 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
* If you use such an index, you can drop `gc_probability` to 0 since
|
||||
* no garbage-collection is required.
|
||||
*
|
||||
* @param \Mongo|\MongoClient $mongo A MongoClient or Mongo instance
|
||||
* @param array $options An associative array of field options
|
||||
* @param \Mongo|\MongoClient|\MongoDB\Client $mongo A MongoDB\Client, MongoClient or Mongo instance
|
||||
* @param array $options An associative array of field options
|
||||
*
|
||||
* @throws \InvalidArgumentException When MongoClient or Mongo instance not provided
|
||||
* @throws \InvalidArgumentException When "database" or "collection" not provided
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
@ -108,7 +108,9 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
*/
|
||||
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,
|
||||
));
|
||||
|
||||
@ -120,8 +122,10 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
*/
|
||||
public function gc($maxlifetime)
|
||||
{
|
||||
$this->getCollection()->remove(array(
|
||||
$this->options['expiry_field'] => array('$lt' => new \MongoDate()),
|
||||
$methodName = $this->mongo instanceof \MongoDB\Client ? 'deleteOne' : 'remove';
|
||||
|
||||
$this->getCollection()->$methodName(array(
|
||||
$this->options['expiry_field'] => array('$lt' => $this->createDateTime()),
|
||||
));
|
||||
|
||||
return true;
|
||||
@ -132,18 +136,28 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
*/
|
||||
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(
|
||||
$this->options['data_field'] => new \MongoBinData($data, \MongoBinData::BYTE_ARRAY),
|
||||
$this->options['time_field'] => new \MongoDate(),
|
||||
$this->options['time_field'] => $this->createDateTime(),
|
||||
$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('$set' => $fields),
|
||||
array('upsert' => true, 'multiple' => false)
|
||||
$options
|
||||
);
|
||||
|
||||
return true;
|
||||
@ -156,10 +170,18 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
|
||||
{
|
||||
$dbData = $this->getCollection()->findOne(array(
|
||||
$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 \Mongo
|
||||
* @return \Mongo|\MongoClient|\MongoDB\Client
|
||||
*/
|
||||
protected function getMongo()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ use Symfony\Component\HttpFoundation\Session\Storage\Handler\MongoDbSessionHandl
|
||||
|
||||
/**
|
||||
* @author Markus Bachmann <markus.bachmann@bachi.biz>
|
||||
* @requires extension mongo
|
||||
* @group time-sensitive
|
||||
*/
|
||||
class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
@ -31,7 +30,15 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
|
||||
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';
|
||||
}
|
||||
|
||||
$this->mongo = $this->getMockBuilder($mongoClass)
|
||||
->disableOriginalConstructor()
|
||||
@ -98,14 +105,28 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$that->assertArrayHasKey($that->options['expiry_field'], $criteria);
|
||||
$that->assertArrayHasKey('$gte', $criteria[$that->options['expiry_field']]);
|
||||
$that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$gte']);
|
||||
$that->assertGreaterThanOrEqual($criteria[$that->options['expiry_field']]['$gte']->sec, $testTimeout);
|
||||
|
||||
return array(
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$gte']);
|
||||
$that->assertGreaterThanOrEqual(round(intval((string) $criteria[$that->options['expiry_field']]['$gte']) / 1000), $testTimeout);
|
||||
} else {
|
||||
$that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$gte']);
|
||||
$that->assertGreaterThanOrEqual($criteria[$that->options['expiry_field']]['$gte']->sec, $testTimeout);
|
||||
}
|
||||
|
||||
$fields = array(
|
||||
$that->options['id_field'] => 'foo',
|
||||
$that->options['data_field'] => new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY),
|
||||
$that->options['id_field'] => new \MongoDate(),
|
||||
);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$fields[$that->options['data_field']] = new \MongoDB\BSON\Binary('bar', \MongoDB\BSON\Binary::TYPE_OLD_BINARY);
|
||||
$fields[$that->options['id_field']] = new \MongoDB\BSON\UTCDateTime(time() * 1000);
|
||||
} else {
|
||||
$fields[$that->options['data_field']] = new \MongoBinData('bar', \MongoBinData::BYTE_ARRAY);
|
||||
$fields[$that->options['id_field']] = new \MongoDate();
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}));
|
||||
|
||||
$this->assertEquals('bar', $this->storage->read('foo'));
|
||||
@ -123,11 +144,18 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$that = $this;
|
||||
$data = array();
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('update')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria, $updateData, $options) use ($that, &$data) {
|
||||
$that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria);
|
||||
$that->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertEquals(array('upsert' => true), $options);
|
||||
} else {
|
||||
$that->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
}
|
||||
|
||||
$data = $updateData['$set'];
|
||||
}));
|
||||
@ -135,10 +163,17 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$expectedExpiry = time() + (int) ini_get('session.gc_maxlifetime');
|
||||
$this->assertTrue($this->storage->write('foo', 'bar'));
|
||||
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->bin);
|
||||
$that->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
|
||||
$this->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
|
||||
$this->assertGreaterThanOrEqual($expectedExpiry, $data[$this->options['expiry_field']]->sec);
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertEquals('bar', $data[$that->options['data_field']]->getData());
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['time_field']]);
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['expiry_field']]);
|
||||
$that->assertGreaterThanOrEqual($expectedExpiry, round(intval((string) $data[$that->options['expiry_field']]) / 1000));
|
||||
} else {
|
||||
$that->assertEquals('bar', $data[$that->options['data_field']]->bin);
|
||||
$that->assertInstanceOf('MongoDate', $data[$that->options['time_field']]);
|
||||
$that->assertInstanceOf('MongoDate', $data[$that->options['expiry_field']]);
|
||||
$that->assertGreaterThanOrEqual($expectedExpiry, $data[$that->options['expiry_field']]->sec);
|
||||
}
|
||||
}
|
||||
|
||||
public function testWriteWhenUsingExpiresField()
|
||||
@ -164,20 +199,33 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$that = $this;
|
||||
$data = array();
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('update')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria, $updateData, $options) use ($that, &$data) {
|
||||
$that->assertEquals(array($that->options['id_field'] => 'foo'), $criteria);
|
||||
$that->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertEquals(array('upsert' => true), $options);
|
||||
} else {
|
||||
$that->assertEquals(array('upsert' => true, 'multiple' => false), $options);
|
||||
}
|
||||
|
||||
$data = $updateData['$set'];
|
||||
}));
|
||||
|
||||
$this->assertTrue($this->storage->write('foo', 'bar'));
|
||||
|
||||
$this->assertEquals('bar', $data[$this->options['data_field']]->bin);
|
||||
$that->assertInstanceOf('MongoDate', $data[$this->options['time_field']]);
|
||||
$that->assertInstanceOf('MongoDate', $data[$this->options['expiry_field']]);
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertEquals('bar', $data[$that->options['data_field']]->getData());
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['time_field']]);
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $data[$that->options['expiry_field']]);
|
||||
} else {
|
||||
$that->assertEquals('bar', $data[$that->options['data_field']]->bin);
|
||||
$that->assertInstanceOf('MongoDate', $data[$that->options['time_field']]);
|
||||
$that->assertInstanceOf('MongoDate', $data[$that->options['expiry_field']]);
|
||||
}
|
||||
}
|
||||
|
||||
public function testReplaceSessionData()
|
||||
@ -191,8 +239,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$data = array();
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'updateOne' : 'update';
|
||||
|
||||
$collection->expects($this->exactly(2))
|
||||
->method('update')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria, $updateData, $options) use (&$data) {
|
||||
$data = $updateData;
|
||||
}));
|
||||
@ -200,7 +250,11 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->storage->write('foo', 'bar');
|
||||
$this->storage->write('foo', 'foobar');
|
||||
|
||||
$this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin);
|
||||
if (phpversion('mongodb')) {
|
||||
$this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->getData());
|
||||
} else {
|
||||
$this->assertEquals('foobar', $data['$set'][$this->options['data_field']]->bin);
|
||||
}
|
||||
}
|
||||
|
||||
public function testDestroy()
|
||||
@ -212,8 +266,10 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
->with($this->options['database'], $this->options['collection'])
|
||||
->will($this->returnValue($collection));
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('remove')
|
||||
->method($methodName)
|
||||
->with(array($this->options['id_field'] => 'foo'));
|
||||
|
||||
$this->assertTrue($this->storage->destroy('foo'));
|
||||
@ -230,19 +286,45 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$that = $this;
|
||||
|
||||
$methodName = phpversion('mongodb') ? 'deleteOne' : 'remove';
|
||||
|
||||
$collection->expects($this->once())
|
||||
->method('remove')
|
||||
->method($methodName)
|
||||
->will($this->returnCallback(function ($criteria) use ($that) {
|
||||
$that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$lt']);
|
||||
$that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec);
|
||||
if (phpversion('mongodb')) {
|
||||
$that->assertInstanceOf('MongoDB\BSON\UTCDateTime', $criteria[$that->options['expiry_field']]['$lt']);
|
||||
$that->assertGreaterThanOrEqual(time() - 1, round(intval((string) $criteria[$that->options['expiry_field']]['$lt']) / 1000));
|
||||
} else {
|
||||
$that->assertInstanceOf('MongoDate', $criteria[$that->options['expiry_field']]['$lt']);
|
||||
$that->assertGreaterThanOrEqual(time() - 1, $criteria[$that->options['expiry_field']]['$lt']->sec);
|
||||
}
|
||||
}));
|
||||
|
||||
$this->assertTrue($this->storage->gc(1));
|
||||
}
|
||||
|
||||
public function testGetConnection()
|
||||
{
|
||||
$method = new \ReflectionMethod($this->storage, 'getMongo');
|
||||
$method->setAccessible(true);
|
||||
|
||||
if (phpversion('mongodb')) {
|
||||
$mongoClass = 'MongoDB\Client';
|
||||
} else {
|
||||
$mongoClass = version_compare(phpversion('mongo'), '1.3.0', '<') ? 'Mongo' : 'MongoClient';
|
||||
}
|
||||
|
||||
$this->assertInstanceOf($mongoClass, $method->invoke($this->storage));
|
||||
}
|
||||
|
||||
private function createMongoCollectionMock()
|
||||
{
|
||||
$collection = $this->getMockBuilder('MongoCollection')
|
||||
$collectionClass = 'MongoCollection';
|
||||
if (phpversion('mongodb')) {
|
||||
$collectionClass = 'MongoDB\Collection';
|
||||
}
|
||||
|
||||
$collection = $this->getMockBuilder($collectionClass)
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
|
Reference in New Issue
Block a user