Conditions | 3 |
Paths | 4 |
Total Lines | 33 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
1 | <?php |
||
5 | public function testURLParsing() { |
||
6 | $shouldMatchURLs = array( |
||
7 | 'https://github.com/silverstripe/deploynaut.git', |
||
8 | 'github.com:silverstripe/deploynaut.git', |
||
9 | '[email protected]:silverstripe/deploynaut.git', |
||
10 | 'ssh://[email protected]:22/silverstripe/deploynaut.git' |
||
11 | ); |
||
12 | |||
13 | $project = new DNProject(); |
||
14 | |||
15 | foreach($shouldMatchURLs as $url) { |
||
16 | $project->CVSPath = $url; |
||
17 | $repositoryInterface = $project->getRepositoryInterface(); |
||
18 | |||
19 | $this->assertEquals( |
||
1 ignored issue
–
show
|
|||
20 | 'https://github.com/silverstripe/deploynaut', |
||
21 | $repositoryInterface->URL, |
||
22 | "Failed to extract repository from " . $url |
||
23 | ); |
||
24 | } |
||
25 | |||
26 | $shouldntMatchURLs = array( |
||
27 | 'https://othersite.com/github.com/ranking' |
||
28 | ); |
||
29 | |||
30 | foreach($shouldntMatchURLs as $url) { |
||
31 | $project->CVSPath = $url; |
||
32 | $repositoryInterface = $project->getRepositoryInterface(); |
||
33 | |||
34 | $this->assertNull($repositoryInterface); |
||
35 | } |
||
36 | |||
37 | } |
||
38 | |||
39 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.