Skip to content

Commit

Permalink
Merge branch '11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 30, 2024
2 parents 85833be + cf3e1a5 commit fa2b9e9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/Framework/ExecutionOrderDependencyTest.php
Expand Up @@ -112,4 +112,14 @@ public function testMergeHandlesEmptyDependencyLists(): void
'Right side of merge could be empty',
);
}

public function testEmptyClassOrCallable(): void
{
$empty = new ExecutionOrderDependency('');
$this->assertFalse($empty->shallowClone());
$this->assertFalse($empty->deepClone());
$this->assertFalse($empty->targetIsClass());
$this->assertSame('', $empty->getTargetClassName());

}
}
44 changes: 44 additions & 0 deletions tests/unit/TextUI/Output/Default/DefaultPrinterTest.php
@@ -0,0 +1,44 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TextUI\Output\Default;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\TestCase;
use PHPUnit\TextUI\InvalidSocketException;
use PHPUnit\TextUI\Output\DefaultPrinter;

#[CoversClass(DefaultPrinter::class)]
#[Medium]
final class DefaultPrinterTest extends TestCase
{
public static function providePrinter(): array
{
return [
[DefaultPrinter::standardOutput()],
[DefaultPrinter::standardError()],
[DefaultPrinter::from('socket://hostname:port')],
];
}

#[DataProvider('providePrinter')]
public function testFlush(DefaultPrinter $printer): void
{
$printer->flush();
$this->expectOutputString('');
}

public function testInvalidSocket(): void
{
$this->expectException(InvalidSocketException::class);
DefaultPrinter::from('socket://hostname:port:wrong');
}
}

0 comments on commit fa2b9e9

Please sign in to comment.