Skip to content

Commit

Permalink
Work around failing test cases on Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Nov 6, 2019
1 parent 13e9ff9 commit 1ea8bd3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/Phar/PackagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,29 @@ public function testExec($expectedOutput, $command)
{
$this->expectOutputString($expectedOutput);

// Travis CI occasionally discards (parts of) the output, so add some delay just in case
if (getenv('TRAVIS') === 'true') {
$command .= '; sleep 0.1';
}

$this->packager->exec($command);
}

public function provideExecCommands()
{
return array(
array("\n output\n", 'echo output'),
array("\n error\n", 'echo error >&2'),
array("\n mixed\n errors\n", 'echo mixed && echo errors >&1'),
array(
"\n output\n",
'echo output'
),
array(
"\n error\n",
'echo error >&2'
),
array(
"\n mixed\n errors\n",
'echo mixed && echo errors >&1'
)
);
}

Expand Down
4 changes: 4 additions & 0 deletions tests/Phar/TargetPharTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ class TargetPharTest extends TestCase
*/
public function setUp()
{
if (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID <= 50600) {
$this->markTestSkipped('Unable to mock \Phar on PHP 5.4/5.5');
}

$this->mockPhar = $this->createMock('\Phar');
$this->mockBox = $this->createMock('Herrera\Box\Box');
$this->mockBox->expects($this->any())
Expand Down

0 comments on commit 1ea8bd3

Please sign in to comment.