Differential D14253 Diff 34414 src/applications/diffusion/query/lowlevel/__tests__/DiffusionLowLevelMercurialPathsQueryTests.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/query/lowlevel/__tests__/DiffusionLowLevelMercurialPathsQueryTests.php
- This file was added.
<?php | |||||
final class DiffusionLowLevelMercurialPathsQueryTests | |||||
extends PhabricatorTestCase { | |||||
public function testCommandByVersion() { | |||||
$cases = array( | |||||
array( | |||||
'name' => pht('Version 3.1 returns `locate`'), | |||||
'version' => '3.1', | |||||
'match' => 'locate', | |||||
), | |||||
array( | |||||
'name' => pht('Version 3.2 returns `files`'), | |||||
'version' => '3.2', | |||||
'match' => 'files', | |||||
), | |||||
array( | |||||
'name' => pht('Version 3.3 returns `files`'), | |||||
'version' => '3.3', | |||||
'match' => 'files', | |||||
), | |||||
); | |||||
foreach ($cases as $case) { | |||||
$query = new DiffusionLowLevelMercurialPathsQuery(); | |||||
$actual = $query->getMercurialPathsCommand($case['version']); | |||||
$expect = preg_match('/^'.$case['match'].'/', $actual); | |||||
$this->assertEqual($expect, 1, $case['name']); | |||||
} | |||||
} | |||||
} |