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

--no-logging has no effect #4402

Closed
Slamdunk opened this issue Aug 7, 2020 · 0 comments
Closed

--no-logging has no effect #4402

Slamdunk opened this issue Aug 7, 2020 · 0 comments
Assignees
Labels
feature/logging Issues related to logging test results feature/test-runner CLI test runner type/bug Something is broken

Comments

@Slamdunk
Copy link
Contributor

Slamdunk commented Aug 7, 2020

Q A
PHPUnit version 9.3.1
PHP version 7.4.8
Installation Method Composer

Summary

--no-logging isn't respected, logs are generated anyway

How to reproduce

cd $(mktemp --directory)

composer require phpunit/phpunit:~9.3.0

mkdir src tests

cat <<'EOF' > src/MyFoo.php
<?php

final class MyFoo
{
    public static function foo()
    {
        return 1;
    }
}
EOF

cat <<'EOF' > tests/MyTest.php
<?php

require dirname(__DIR__).'/src/MyFoo.php';

class MyTest extends \PHPUnit\Framework\TestCase
{
    public function testFoo()
    {
        self::assertSame(1, MyFoo::foo());
    }
}
EOF

cat <<'EOF' > phpunit.xml
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
  <testsuites>
    <testsuite name="tests">
      <directory>tests/</directory>
    </testsuite>
  </testsuites>
  <logging>
    <junit outputFile="junit.xml"/>
  </logging>
</phpunit>
EOF

vendor/bin/phpunit --no-logging

Expected vs Actual behavior

 $ ls -lh
 composer.json
 composer.lock
+junit.xml
 phpunit.xml
 src/
 tests/
 vendor/
@Slamdunk Slamdunk added the type/bug Something is broken label Aug 7, 2020
@sebastianbergmann sebastianbergmann added feature/logging Issues related to logging test results feature/test-runner CLI test runner labels Aug 7, 2020
@sebastianbergmann sebastianbergmann self-assigned this Aug 7, 2020
@sebastianbergmann sebastianbergmann changed the title --no-logging not respected --no-logging has no effect Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/logging Issues related to logging test results feature/test-runner CLI test runner type/bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants