Skip to content
Snippets Groups Projects
Verified Commit 25fa70bd authored by Project Update Bot's avatar Project Update Bot Committed by Lee Rowlands
Browse files

Issue #3296699 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent 8e878fdf
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\build_hooks_bitbucket\Unit;
use Prophecy\PhpUnit\ProphecyTrait;
use Drupal\build_hooks\BuildHookDetails;
use Drupal\build_hooks_bitbucket\BitbucketManager;
use Drupal\Tests\UnitTestCase;
......@@ -14,6 +15,7 @@ use GuzzleHttp\ClientInterface;
*/
class BitbucketManagerTest extends UnitTestCase {
use ProphecyTrait;
/**
* Tests getting build hook details..
*/
......
......@@ -26,7 +26,7 @@ class CircleBuildHookTest extends BuildHooksKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installConfig('system');
$this->installConfig('build_hooks_circleci');
......
......@@ -22,7 +22,7 @@ class NetlifyBuildHooksTest extends BuildHooksKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installConfig('build_hooks_netlify');
}
......
......@@ -2,8 +2,8 @@
namespace Drupal\build_hooks\Event;
use Symfony\Contracts\EventDispatcher\Event;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\build_hooks\Plugin\FrontendEnvironmentInterface;
/**
......
......@@ -243,7 +243,7 @@ class Trigger implements TriggerInterface {
$buildHookDetails->getOptions()
);
$event = new ResponseEvent($response, $plugin);
$this->eventDispatcher->dispatch(ResponseEvent::EVENT_NAME, $event);
$this->eventDispatcher->dispatch($event, ResponseEvent::EVENT_NAME);
return $response;
}
......
......@@ -144,7 +144,7 @@ class UiTest extends BrowserTestBase {
*/
private function assertAddEnvironmentForPluginFunctionality() {
$assert = $this->assertSession();
$query = $assert->buildXPathQuery('//a[contains(@href, :href)]', [
$query = $this->assertSession()->buildXPathQuery('//a[contains(@href, :href)]', [
':href' => Url::fromRoute('build_hooks.admin_add', [
'plugin_id' => 'build_hooks_test',
])->toString(),
......
......@@ -48,7 +48,7 @@ abstract class BuildHooksKernelTestBase extends KernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->installConfig('build_hooks');
$this->installConfig('system');
......
......@@ -2,6 +2,7 @@
namespace Drupal\Tests\build_hooks\Kernel;
use Prophecy\PhpUnit\ProphecyTrait;
use Drupal\Component\Datetime\TimeInterface;
use Drupal\entity_test\Entity\EntityTest;
use Drupal\Tests\build_hooks\Traits\EnvironmentTestTrait;
......@@ -14,6 +15,7 @@ use GuzzleHttp\Psr7\Response;
*/
class DeploymentStorageHandlerTest extends BuildHooksKernelTestBase {
use ProphecyTrait;
use EnvironmentTestTrait;
const MOCK_TIME = 1600745446;
......@@ -28,7 +30,7 @@ class DeploymentStorageHandlerTest extends BuildHooksKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->createTestEnvironment();
$time = $this->prophesize(TimeInterface::class);
......
......@@ -17,7 +17,7 @@ class DeploymentValidationTest extends BuildHooksKernelTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
protected function setUp(): void {
parent::setUp();
$this->createTestEnvironment();
}
......@@ -36,7 +36,7 @@ class DeploymentValidationTest extends BuildHooksKernelTestBase {
/** @var \Drupal\Core\Entity\EntityConstraintViolationList $errors */
$errors = $another->validate();
$this->assertCount(1, $errors);
$this->assertRegExp('/There is already an active deployment for this environment/', (string) $errors[0]->getMessage());
$this->assertMatchesRegularExpression('/There is already an active deployment for this environment/', (string) $errors[0]->getMessage());
$this->assertEquals('status', $errors[0]->getPropertyPath());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment