Skip to content

Commit fa2b9e9

Browse files
Merge branch '11.0'
2 parents 85833be + cf3e1a5 commit fa2b9e9

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

tests/unit/Framework/ExecutionOrderDependencyTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,14 @@ public function testMergeHandlesEmptyDependencyLists(): void
112112
'Right side of merge could be empty',
113113
);
114114
}
115+
116+
public function testEmptyClassOrCallable(): void
117+
{
118+
$empty = new ExecutionOrderDependency('');
119+
$this->assertFalse($empty->shallowClone());
120+
$this->assertFalse($empty->deepClone());
121+
$this->assertFalse($empty->targetIsClass());
122+
$this->assertSame('', $empty->getTargetClassName());
123+
124+
}
115125
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TextUI\Output\Default;
11+
12+
use PHPUnit\Framework\Attributes\CoversClass;
13+
use PHPUnit\Framework\Attributes\DataProvider;
14+
use PHPUnit\Framework\Attributes\Medium;
15+
use PHPUnit\Framework\TestCase;
16+
use PHPUnit\TextUI\InvalidSocketException;
17+
use PHPUnit\TextUI\Output\DefaultPrinter;
18+
19+
#[CoversClass(DefaultPrinter::class)]
20+
#[Medium]
21+
final class DefaultPrinterTest extends TestCase
22+
{
23+
public static function providePrinter(): array
24+
{
25+
return [
26+
[DefaultPrinter::standardOutput()],
27+
[DefaultPrinter::standardError()],
28+
[DefaultPrinter::from('socket://hostname:port')],
29+
];
30+
}
31+
32+
#[DataProvider('providePrinter')]
33+
public function testFlush(DefaultPrinter $printer): void
34+
{
35+
$printer->flush();
36+
$this->expectOutputString('');
37+
}
38+
39+
public function testInvalidSocket(): void
40+
{
41+
$this->expectException(InvalidSocketException::class);
42+
DefaultPrinter::from('socket://hostname:port:wrong');
43+
}
44+
}

0 commit comments

Comments
 (0)