Skip to content

Commit

Permalink
Add reproducing test case for #3739
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 27, 2019
1 parent 5dc0162 commit 0738d51
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/end-to-end/regression/GitHub/3739.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/3739
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][2] = 'Issue3739Test';
$_SERVER['argv'][3] = __DIR__ . '/3739/Issue3739Test.php';

require __DIR__ . '/../../../bootstrap.php';

PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

. 1 / 1 (100%)

Time: %s, Memory: %s

OK (1 test, 1 assertion)
20 changes: 20 additions & 0 deletions tests/end-to-end/regression/GitHub/3739/Issue3739Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php declare(strict_types=1);
namespace Issue3739;

use PHPUnit\Framework\TestCase;

class Issue3739
{
public function unlinkFileThatDoesNotExist(): bool
{
return @unlink(__DIR__ . '/DOES_NOT_EXIST');
}
}

final class Issue3739Test extends TestCase
{
public function testOne(): void
{
$this->assertFalse((new Issue3739())->unlinkFileThatDoesNotExist());
}
}

0 comments on commit 0738d51

Please sign in to comment.