Passed
Branch master (c65b3c)
by Jan
05:40 queued 01:37
created

BasicTest::testPush()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 18
rs 9.4285
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace Tests\Functional;
4
5
class BasicTest extends AbstractTestCase
6
{
7
8 View Code Duplication
    public function testDeploy()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
    {
10
		$response = $this->runApp(
11
			file_get_contents(__DIR__ . '/data/pipeline.json'),
12
			[
13
				'HOOK_PROJECT_PATH' => 'gitlab-org/gitlab-test',
14
				'HOOK_BUILD_ID' => 379,
15
				'HOOK_BUILD_REF' => 'bcbb5ec396a2c0f828686f14fac9b80b780504f2',
16
				'HOOK_ENV_NAME' => 'staging'
17
			],
18
			'bash /testing-dir/script.bash deploy'
19
		);
20
21
        $this->assertEquals(200, $response->getStatusCode());
22
    }
23
24
25
    public function testPush()
26
    {
27
		$response = $this->runApp(
28
			file_get_contents(__DIR__ . '/data/push.json'),
29
			[
30
				'HOOK_PROJECT_PATH' => 'gitlab-org/gitlab-test',
31
				'HOOK_REF' => 'refs/heads/master',
32
				'HOOK_BRANCH' => 'master',
33
				'HOOK_BUILD_REF' => 'da1560886d4f094c3e6c9ef40349f7d38b5d27d7'
34
			],
35
			[
36
				'cwd' => '/testing-dir',
37
				'command' => 'bash /testing-dir/script.bash push'
38
			]
39
		);
40
41
		$this->assertEquals(200, $response->getStatusCode());
42
    }
43
44
45 View Code Duplication
	public function testPushTag()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
46
	{
47
		$response = $this->runApp(
48
			file_get_contents(__DIR__ . '/data/tag.json'),
49
			[
50
				'HOOK_PROJECT_PATH' => 'jsmith/example',
51
				'HOOK_REF' => 'refs/tags/v1.0.0',
52
				'HOOK_TAG' => 'v1.0.0',
53
				'HOOK_BUILD_REF' => '82b3d5ae55f7080f1e6022629cdb57bfae7cccc7'
54
			],
55
			'bash /testing-dir/script.bash tag'
56
		);
57
58
		$this->assertEquals(200, $response->getStatusCode());
59
	}
60
61
62
	public function testNo()
63
	{
64
		$response = $this->runApp('', [], NULL);
65
66
		$this->assertEquals(500, $response->getStatusCode());
67
	}
68
69
}
70