Verified Commit b1305b58 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3254199 by longwave: Remove Prophecy PhpUnit compatibility check

(cherry picked from commit eaa010f9)
parent 964a3f3a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

use Drupal\media\OEmbed\ProviderException;
use GuzzleHttp\Psr7\Utils;
use Prophecy\PhpUnit\ProphecyTrait;

/**
 * Tests the oEmbed provider repository.
@@ -14,6 +15,8 @@
 */
class ProviderRepositoryTest extends MediaFunctionalTestBase {

  use ProphecyTrait;

  /**
   * {@inheritdoc}
   */
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@
use Drupal\TestTools\TestVarDumper;
use PHPUnit\Framework\Exception;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Request;
@@ -89,6 +90,7 @@ abstract class KernelTestBase extends TestCase implements ServiceProviderInterfa
  use TestRequirementsTrait;
  use PhpUnitWarnings;
  use PhpUnitCompatibilityTrait;
  use ProphecyTrait;
  use ExpectDeprecationTrait;

  /**
+0 −10
Original line number Diff line number Diff line
@@ -2,19 +2,9 @@

namespace Drupal\TestTools\PhpUnitCompatibility\PhpUnit9;

use Prophecy\PhpUnit\ProphecyTrait;

// @todo Replace with a proper dependency when we stop supporting PHPUnit 8.
if (!trait_exists(ProphecyTrait::class)) {
  print "Drupal requires Prophecy PhpUnit when using PHPUnit 9 or greater. Please use 'composer require --dev phpspec/prophecy-phpunit:^2' to ensure that it is present.\n";
  exit(1);
}

/**
 * Drupal's forward compatibility layer with multiple versions of PHPUnit.
 */
trait TestCompatibilityTrait {

  use ProphecyTrait;

}
+2 −2
Original line number Diff line number Diff line
@@ -6,8 +6,8 @@
use Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator;
use Drupal\Component\Plugin\Definition\PluginDefinition;
use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
use Drupal\Tests\PhpUnitCompatibilityTrait;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

/**
 * @coversDefaultClass \Drupal\Component\Annotation\Plugin\Discovery\AnnotationBridgeDecorator
@@ -15,7 +15,7 @@
 */
class AnnotationBridgeDecoratorTest extends TestCase {

  use PhpUnitCompatibilityTrait;
  use ProphecyTrait;

  /**
   * @covers ::getDefinitions
+2 −2
Original line number Diff line number Diff line
@@ -8,8 +8,8 @@
namespace Drupal\Tests\Component\DependencyInjection;

use Drupal\Component\Utility\Crypt;
use Drupal\Tests\PhpUnitCompatibilityTrait;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Exception\LogicException;
@@ -25,7 +25,7 @@
 */
class ContainerTest extends TestCase {

  use PhpUnitCompatibilityTrait;
  use ProphecyTrait;

  /**
   * The tested container.
Loading