File tree Expand file tree Collapse file tree 4 files changed +38
-4
lines changed
src/Framework/MockObject/Runtime/Api Expand file tree Collapse file tree 4 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,12 @@ public function __phpunit_state(): TestDoubleState
26
26
/** @noinspection MagicMethodsValidityInspection */
27
27
public function __phpunit_getInvocationHandler (): InvocationHandler
28
28
{
29
- return $ this ->__phpunit_state ->invocationHandler ();
29
+ return $ this ->__phpunit_state () ->invocationHandler ();
30
30
}
31
31
32
32
/** @noinspection MagicMethodsValidityInspection */
33
33
public function __phpunit_unsetInvocationMocker (): void
34
34
{
35
- $ this ->__phpunit_state ->unsetInvocationHandler ();
35
+ $ this ->__phpunit_state () ->unsetInvocationHandler ();
36
36
}
37
37
}
Original file line number Diff line number Diff line change @@ -24,12 +24,12 @@ public function __phpunit_state(): TestDoubleState
24
24
/** @noinspection MagicMethodsValidityInspection */
25
25
public function __phpunit_getInvocationHandler (): InvocationHandler
26
26
{
27
- return $ this ->__phpunit_state ->invocationHandler ();
27
+ return $ this ->__phpunit_state () ->invocationHandler ();
28
28
}
29
29
30
30
/** @noinspection MagicMethodsValidityInspection */
31
31
public function __phpunit_unsetInvocationMocker (): void
32
32
{
33
- $ this ->__phpunit_state ->unsetInvocationHandler ();
33
+ $ this ->__phpunit_state () ->unsetInvocationHandler ();
34
34
}
35
35
}
Original file line number Diff line number Diff line change
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 \TestFixture ;
11
+
12
+ final class NoTestCase
13
+ {
14
+ }
Original file line number Diff line number Diff line change 11
11
12
12
use PHPUnit \Framework \Attributes \CoversClass ;
13
13
use PHPUnit \Framework \Attributes \Small ;
14
+ use PHPUnit \TestFixture \AbstractTestCase ;
14
15
use PHPUnit \TestFixture \DependencyFailureTest ;
15
16
use PHPUnit \TestFixture \DependencyOnClassTest ;
16
17
use PHPUnit \TestFixture \DependencySuccessTest ;
17
18
use PHPUnit \TestFixture \MultiDependencyTest ;
19
+ use PHPUnit \TestFixture \NoTestCase ;
18
20
use PHPUnit \TestFixture \NotPublicTestCase ;
19
21
use ReflectionClass ;
20
22
@@ -113,4 +115,22 @@ public function testResolverOnlyUsesSuitesAndCases(): void
113
115
DependencyFailureTest::class . '::class ' ,
114
116
], $ suite ->requires (), 'Required test names incorrect ' );
115
117
}
118
+
119
+ public function testRejectsAbstractTestClass (): void
120
+ {
121
+ $ suite = TestSuite::empty ('the-test-suite ' );
122
+
123
+ $ this ->expectException (Exception::class);
124
+
125
+ $ suite ->addTestSuite (new ReflectionClass (AbstractTestCase::class));
126
+ }
127
+
128
+ public function testRejectsClassThatDoesNotExtendTestClass (): void
129
+ {
130
+ $ suite = TestSuite::empty ('the-test-suite ' );
131
+
132
+ $ this ->expectException (Exception::class);
133
+
134
+ $ suite ->addTestSuite (new ReflectionClass (NoTestCase::class));
135
+ }
116
136
}
You can’t perform that action at this time.
0 commit comments