You are here

public function GithubBuildHooksTest::testGithubFrontendEnvironment in Build Hooks 3.x

Tests Github Pipelines front-end environment deployments.

@dataProvider providerFrontendEnvironment

File

modules/build_hooks_github/tests/src/Kernel/GithubBuildHooksTest.php, line 57

Class

GithubBuildHooksTest
Defines a test for the configuration form of the github workflow plugin.

Namespace

Drupal\Tests\build_hooks_github\Kernel

Code

public function testGithubFrontendEnvironment(string $deployment_strategy = TriggerInterface::DEPLOYMENT_STRATEGY_ENTITYSAVE) {
  $random = $this
    ->getRandomGenerator()
    ->name();
  $this
    ->assertFrontendEnvironmentBuildHook('github', $deployment_strategy, 'https://api.github.com/repos/' . $random . '-owner/' . $random . '-repo/actions/workflows/' . $random . '-workflow_id/dispatches', [
    'build_hook_url' => 'https://api.github.com/repos/' . $random . '-owner/' . $random . '-repo/actions/workflows/' . $random . '-workflow_id/dispatches',
    'branch' => 'branch',
  ], new Response(201, [], 'Hello, Github'));
}