phpunit throws “Argument #3 (No Value) of PHPUnit_TextUI_ResultPrinter::__construct() must be a value from ”never“, ”auto“ or ”always“”

后端 未结 2 1718
感动是毒
感动是毒 2021-01-13 04:03

I\'m just test playing with Php unit.

Here is my DependencyFailureTest class:

require_once \'../vendor/autoload.php\';
use PHPUnit\\Framework\\TestC         


        
相关标签:
2条回答
  • 2021-01-13 04:24

    It must be a configuration issue. I copied your code and ran it on the command line with verbose and it worked fine with version 5.4.6.

    I would reinstall phpunit and ensure you have the latest version.

    Also, their sample test case from their Getting Started page is:

    <?php
    use PHPUnit\Framework\TestCase;
    
    class MoneyTest extends TestCase
    {
        // ...
    
        public function testCanBeNegated()
        {
            // Arrange
            $a = new Money(1);
    
            // Act
            $b = $a->negate();
    
            // Assert
            $this->assertEquals(-1, $b->getAmount());
        }
    
        // ...
    }
    

    https://phpunit.de/getting-started.html

    Notice the difference in your extension usage, although I don't think it is an issue, if you use their declaration as stated, it helps to isolate the problem.

    0 讨论(0)
  • 2021-01-13 04:37

    I ran into this. Was passing --colors=true, but that is incorrect.

    0 讨论(0)
提交回复
热议问题