Files
archived-console/Tests/Formatter/NullOutputFormatterTest.php
Alexander M. Turek b0562497d1 Add return type to OutputFormatterInterface::format()
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-08-05 07:10:47 +02:00

65 lines
1.8 KiB
PHP

<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Tests\Formatter;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Formatter\NullOutputFormatter;
use Symfony\Component\Console\Formatter\NullOutputFormatterStyle;
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
/**
* @author Tien Xuan Vo <tien.xuan.vo@gmail.com>
*/
class NullOutputFormatterTest extends TestCase
{
public function testFormat()
{
$formatter = new NullOutputFormatter();
$this->assertNull($formatter->format('this message will be destroyed'));
}
public function testGetStyle()
{
$formatter = new NullOutputFormatter();
$this->assertInstanceof(NullOutputFormatterStyle::class, $style = $formatter->getStyle('null'));
$this->assertSame($style, $formatter->getStyle('null'));
}
public function testSetStyle()
{
$formatter = new NullOutputFormatter();
$style = new OutputFormatterStyle();
$formatter->setStyle('null', $style);
$this->assertNotSame($style, $formatter->getStyle('null'));
}
public function testHasStyle()
{
$formatter = new NullOutputFormatter();
$this->assertFalse($formatter->hasStyle('null'));
}
public function testIsDecorated()
{
$formatter = new NullOutputFormatter();
$this->assertFalse($formatter->isDecorated());
}
public function testSetDecorated()
{
$formatter = new NullOutputFormatter();
$formatter->setDecorated(true);
$this->assertFalse($formatter->isDecorated());
}
}