Merge branch '2.8' into 3.4

* 2.8:
  [HttpFoundation] update phpdoc of FlashBagInterface::add()
  bug #27701 [SecurityBundle] Dont throw if "security.http_utils" is not found (nicolas-grekas)
  [Validator] Fix the namespace of RegexTest
This commit is contained in:
Nicolas Grekas 2018-06-29 18:28:23 +02:00
commit 493ce7a64b
3 changed files with 14 additions and 2 deletions

View File

@ -24,7 +24,7 @@ interface FlashBagInterface extends SessionBagInterface
* Adds a flash message for type.
*
* @param string $type
* @param string $message
* @param mixed $message
*/
public function add($type, $message);

View File

@ -74,6 +74,18 @@ class FlashBagTest extends TestCase
$this->assertEquals(array('A previous flash message'), $this->bag->peek('notice'));
}
public function testAdd()
{
$tab = array('bar' => 'baz');
$this->bag->add('string_message', 'lorem');
$this->bag->add('object_message', new \stdClass());
$this->bag->add('array_message', $tab);
$this->assertEquals(array('lorem'), $this->bag->get('string_message'));
$this->assertEquals(array(new \stdClass()), $this->bag->get('object_message'));
$this->assertEquals(array($tab), $this->bag->get('array_message'));
}
public function testGet()
{
$this->assertEquals(array(), $this->bag->get('non_existing'));

View File

@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
namespace Constraints;
namespace Symfony\Component\Validator\Tests\Constraints;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Validator\Constraints\Regex;