Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output made while test is running is printed although expectOutputString() is used when an assertion fails #1471

Closed
sebastianbergmann opened this issue Oct 16, 2014 · 0 comments
Labels
type/bug Something is broken

Comments

@sebastianbergmann
Copy link
Owner

<?php
class Test extends PHPUnit_Framework_TestCase
{
    public function testOne()
    {
        $this->expectOutputString('*');

        print "*";

        $this->assertTrue(false);
    }
}
$ phpunit Test
PHPUnit 4.3.2 by Sebastian Bergmann.

F*

Time: 45 ms, Memory: 4.00Mb

There was 1 failure:

1) Test::testOne
Failed asserting that false is true.

/home/sb/Test.php:10

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
@sebastianbergmann sebastianbergmann added the type/bug Something is broken label Oct 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant