You are here

public function BitbucketBuildHooksTest::testBitbucketFrontendEnvironment in Build Hooks 3.x

Tests Bitbucket Pipelines front-end environment deployments.

@dataProvider providerFrontendEnvironment

File

modules/build_hooks_bitbucket/tests/src/Kernel/BitbucketBuildHooksTest.php, line 57

Class

BitbucketBuildHooksTest
Defines a test for the configuration form of the bitbucket pipelines plugin.

Namespace

Drupal\Tests\build_hooks_bitbucket\Kernel

Code

public function testBitbucketFrontendEnvironment(string $deployment_strategy = TriggerInterface::DEPLOYMENT_STRATEGY_ENTITYSAVE) {
  $random = $this
    ->getRandomGenerator()
    ->name();
  $this
    ->assertFrontendEnvironmentBuildHook('bitbucket', $deployment_strategy, 'https://api.bitbucket.org/2.0/repositories/' . $random . '-workspace/' . $random . '-slug/pipelines/', [
    'repo' => [
      'workspace' => $random . '-workspace',
      'slug' => $random . '-slug',
    ],
    'ref' => [
      'name' => $random . '-ref',
      'type' => 'branch',
    ],
    'selector' => [
      'name' => $random . '-selector',
      'type' => 'pull-requests',
    ],
  ], new Response(201, [], 'Hello, Bitbucket'));
}