Skip to content

Commit 1f67d32

Browse files
Delete useless tests
1 parent 40e4190 commit 1f67d32

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

tests/unit/Framework/TestBuilderTest.php

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
*/
1010
namespace PHPUnit\Framework;
1111

12-
use function assert;
1312
use EmptyDataProviderTest;
1413
use ModifiedConstructorTestCase;
15-
use PHPUnit\Framework\MockObject\MockObject;
1614
use ReflectionClass;
1715
use TestWithAnnotations;
1816

@@ -21,56 +19,6 @@
2119
*/
2220
final class TestBuilderTest extends TestCase
2321
{
24-
public function testCreateTestForConstructorlessTestClass(): void
25-
{
26-
$reflector = $this->getMockBuilder(ReflectionClass::class)
27-
->setConstructorArgs([$this])
28-
->getMock();
29-
30-
assert($reflector instanceof MockObject);
31-
assert($reflector instanceof ReflectionClass);
32-
33-
$reflector->expects($this->once())
34-
->method('getConstructor')
35-
->willReturn(null);
36-
37-
$reflector->expects($this->once())
38-
->method('isInstantiable')
39-
->willReturn(true);
40-
41-
$reflector->expects($this->once())
42-
->method('getName')
43-
->willReturn(__CLASS__);
44-
45-
$this->expectException(Exception::class);
46-
$this->expectExceptionMessage('No valid test provided.');
47-
48-
(new TestBuilder)->build($reflector, 'TestForConstructorlessTestClass');
49-
}
50-
51-
public function testCreateTestForNotInstantiableTestClass(): void
52-
{
53-
$reflector = $this->getMockBuilder(ReflectionClass::class)
54-
->setConstructorArgs([$this])
55-
->getMock();
56-
57-
assert($reflector instanceof MockObject);
58-
assert($reflector instanceof ReflectionClass);
59-
60-
$reflector->expects($this->once())
61-
->method('isInstantiable')
62-
->willReturn(false);
63-
64-
$reflector->expects($this->once())
65-
->method('getName')
66-
->willReturn('foo');
67-
68-
$test = (new TestBuilder)->build($reflector, 'TestForNonInstantiableTestClass');
69-
$this->assertInstanceOf(WarningTestCase::class, $test);
70-
/* @var WarningTestCase $test */
71-
$this->assertSame('Cannot instantiate class "foo".', $test->getMessage());
72-
}
73-
7422
public function testCreateTestForTestClassWithModifiedConstructor(): void
7523
{
7624
$test = (new TestBuilder)->build(new ReflectionClass(ModifiedConstructorTestCase::class), 'testCase');

0 commit comments

Comments
 (0)