Skip to content

Commit

Permalink
Merge branch '5.0'
Browse files Browse the repository at this point in the history
* 5.0: (31 commits)
  [HttpClient] NativeHttpClient should not send >1.1 protocol version
  [HttpClient] fix support for non-blocking resource streams
  [Mailer] Make sure you can pass custom headers to Mailgun
  [Mailer] Remove line breaks in email attachment content
  Update links to documentation
  [Validator] Add the missing translations for the Arabic (ar) locale
  ensure to expect no validation for the right reasons
  [Security-Guard] fixed 35203 missing name tag in param docblock
  [HttpClient] fix casting responses to PHP streams
  [PhpUnitBridge] Add test case for @expectedDeprecation annotation
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove $testsWithWarnings stack
  [FrameworkBundle] Fix getUser() phpdoc in AbstractController
  [Mailer] Fix addresses management in Sendgrid API payload
  [Mailer][MailchimpBridge] Fix missing attachments when sending via Mandrill API
  [Mailer][MailchimpBridge] Fix incorrect sender address when sender has name
  [HttpClient] fix capturing SSL certificates with NativeHttpClient
  Update year in license files
  Update year in license files
  [TwigBridge][Form] Added missing help messages in form themes
  Update year in license files
  ...
  • Loading branch information
nicolas-grekas committed Jan 4, 2020
2 parents f427fd5 + fb75c37 commit 77d9a11
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2019 Fabien Potencier
Copyright (c) 2014-2020 Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 0 additions & 5 deletions Legacy/SymfonyTestsListenerForV5.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ public function startTest(\PHPUnit_Framework_Test $test)
$this->trait->startTest($test);
}

public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time)
{
$this->trait->addWarning($test, $e, $time);
}

public function endTest(\PHPUnit_Framework_Test $test, $time)
{
$this->trait->endTest($test, $time);
Expand Down
5 changes: 0 additions & 5 deletions Legacy/SymfonyTestsListenerForV6.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ public function startTest(Test $test)
$this->trait->startTest($test);
}

public function addWarning(Test $test, Warning $e, $time)
{
$this->trait->addWarning($test, $e, $time);
}

public function endTest(Test $test, $time)
{
$this->trait->endTest($test, $time);
Expand Down
5 changes: 0 additions & 5 deletions Legacy/SymfonyTestsListenerForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public function startTest(Test $test): void
$this->trait->startTest($test);
}

public function addWarning(Test $test, Warning $e, float $time): void
{
$this->trait->addWarning($test, $e, $time);
}

public function endTest(Test $test, float $time): void
{
$this->trait->endTest($test, $time);
Expand Down
9 changes: 0 additions & 9 deletions Legacy/SymfonyTestsListenerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class SymfonyTestsListenerTrait
private $expectedDeprecations = array();
private $gatheredDeprecations = array();
private $previousErrorHandler;
private $testsWithWarnings;
private $reportUselessTests;
private $error;
private $runsInSeparateProcess = false;
Expand Down Expand Up @@ -112,7 +111,6 @@ public function globalListenerDisabled()
public function startTestSuite($suite)
{
$suiteName = $suite->getName();
$this->testsWithWarnings = array();

foreach ($suite->tests() as $test) {
if (!($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
Expand Down Expand Up @@ -236,13 +234,6 @@ public function startTest($test)
}
}

public function addWarning($test, $e, $time)
{
if ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase) {
$this->testsWithWarnings[$test->getName()] = true;
}
}

public function endTest($test, $time)
{
if (class_exists(DebugClassLoader::class, false)) {
Expand Down
43 changes: 43 additions & 0 deletions Tests/ExpectedDeprecationAnnotationTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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\Bridge\PhpUnit\Tests;

use PHPUnit\Framework\TestCase;

final class ExpectedDeprecationAnnotationTest extends TestCase
{
/**
* Do not remove this test in the next major versions.
*
* @group legacy
*
* @expectedDeprecation foo
*/
public function testOne()
{
@trigger_error('foo', E_USER_DEPRECATED);
}

/**
* Do not remove this test in the next major versions.
*
* @group legacy
*
* @expectedDeprecation foo
* @expectedDeprecation bar
*/
public function testMany()
{
@trigger_error('foo', E_USER_DEPRECATED);
@trigger_error('bar', E_USER_DEPRECATED);
}
}

0 comments on commit 77d9a11

Please sign in to comment.