Skip to content

Commit b1ff2b2

Browse files
committed
Fix test breaks for PHP 5.3
1 parent 9e68b98 commit b1ff2b2

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/Acceptance/KindsTest.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ protected function setUp()
88
{
99
parent::setUp();
1010

11-
$this->givenSourceFile('KindsExample.php', <<<'EOS'
11+
$sourceCode =<<<'EOS'
1212
<?php
1313
namespace KindsExampleNamespace;
1414
class KindsExampleClass
@@ -42,12 +42,17 @@ function kindsExampleFunction()
4242
interface KindsExampleInterface
4343
{
4444
}
45+
EOS;
4546

47+
if (version_compare('5.4.0', PHP_VERSION, '<=')) {
48+
$sourceCode .= <<<EOS
4649
trait KindsExampleTrait
4750
{
4851
}
49-
EOS
50-
);
52+
EOS;
53+
}
54+
55+
$this->givenSourceFile('KindsExample.php', $sourceCode);
5156
}
5257

5358
/**
@@ -243,6 +248,10 @@ public function itSupportsInterfaceKindsParameter()
243248
*/
244249
public function itSupportsTraitKindsParameter()
245250
{
251+
if (version_compare('5.4.0', PHP_VERSION, '>')) {
252+
$this->markTestSkipped('Traits were not introduced until 5.4');
253+
}
254+
246255
$this->runPHPCtagsWithKinds('t');
247256

248257
$this->assertTagsFileHeaderIsCorrect();
@@ -251,7 +260,7 @@ public function itSupportsTraitKindsParameter()
251260
'KindsExample.php',
252261
'KindsExampleTrait',
253262
self::KIND_TRAIT,
254-
35,
263+
33,
255264
'namespace:KindsExampleNamespace'
256265
);
257266
}

0 commit comments

Comments
 (0)