Verified Commit 5dd92df9 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3446542 by mondrake: Replace @before*|@after* test annotations with attributes

(cherry picked from commit 356ba1fc)
parent 007556a0
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
use Drupal\TestTools\Extension\DeprecationBridge\ExpectDeprecationTrait;
use Drupal\TestTools\Extension\SchemaInspector;
use Drupal\TestTools\TestVarDumper;
use PHPUnit\Framework\Attributes\After;
use PHPUnit\Framework\Exception;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
@@ -697,10 +698,9 @@ protected function tearDown(): void {
  }

  /**
   * @after
   *
   * Additional tear down method to close the connection at the end.
   */
  #[After]
  public function tearDownCloseDatabaseConnection() {
    // Destroy the database connection, which for example removes the memory
    // from sqlite in memory.
+2 −3
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

namespace Drupal\TestTools\Extension;

use PHPUnit\Framework\Attributes\BeforeClass;
use Symfony\Component\Process\ExecutableFinder;

/**
@@ -11,9 +12,7 @@
 */
trait RequiresComposerTrait {

  /**
   * @beforeClass
   */
  #[BeforeClass]
  public static function requiresComposer(): void {
    if (!((new ExecutableFinder())->find('composer'))) {
      static::markTestSkipped('This test requires the Composer executable to be accessible.');