Skip to content

Commit dc484ed

Browse files
committed
No test failing with hg < 3, fix coding style
1 parent 778ca88 commit dc484ed

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Liip/RMT/Config/Handler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ protected function validateRootElements($config)
130130
}
131131
}
132132

133-
if($config['version-generator'] == 'simple'
133+
if ($config['version-generator'] == 'simple'
134134
&& isset($config['vcs']) && $config['vcs'] == 'hg'
135135
&& (! isset($config['version-persister']['tag-prefix']) || strlen(trim($config['version-persister']['tag-prefix'])) == 0))
136136
{
137137
exec('hg version', $result);
138138
preg_match('/version (\d+)\.\d+\.\d+/', reset($result), $matches);
139-
if(intval($matches[1]) >= 3) {
139+
if (intval($matches[1]) >= 3) {
140140
throw new Exception("Simple generator is not compatible with mercurial > 3.");
141141
}
142142

test/Liip/RMT/Tests/Functional/HgTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ public function testNoSimpleGenerator()
2727
$this->initHg();
2828
$this->createConfig('simple', 'vcs-tag', array('vcs' => 'hg'));
2929
exec('./RMT release -n --confirm-first', $result, $code);
30-
$this->assertEquals($code, 1);
30+
31+
exec('hg version', $result);
32+
preg_match('/version (\d+)\.\d+\.\d+/', reset($result), $matches);
33+
$expected = $matches[1]) >= 3 ? 1 : 0;
34+
$this->assertEquals($code, $expected);
3135
}
3236

3337
public function testInitialVersion()

0 commit comments

Comments
 (0)