File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
tests/end-to-end/regression Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ https://github.com/sebastianbergmann/phpunit/issues/6095
3
+ --XFAIL--
4
+ https://github.com/sebastianbergmann/phpunit/issues/6095
5
+ --FILE--
6
+ <?php declare (strict_types=1 );
7
+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
8
+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
9
+ $ _SERVER ['argv ' ][] = __DIR__ . '/6095/Issue6095Test.php ' ;
10
+
11
+ require_once __DIR__ . '/../../bootstrap.php ' ;
12
+
13
+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
14
+ --EXPECTF --
15
+ PHPUnit %s by Sebastian Bergmann and contributors.
16
+
17
+ Runtime: %s
18
+
19
+ F 1 / 1 (100 %)
20
+
21
+ Time: %s, Memory: %s
22
+
23
+ There was 1 failure:
24
+
25
+ 1 ) PHPUnit \TestFixture \Issue6095 \Issue6095Test::testOne
26
+ PHPUnit\TestFixture \MockObject \AnInterface::doSomething() was not expected to be called more than once.
27
+
28
+ %sIssue6095Test.php:26
29
+
30
+ FAILURES !
31
+ Tests: 1 , Assertions: 1 , Failures: 1.
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 \Issue6095 ;
11
+
12
+ use PHPUnit \Framework \TestCase ;
13
+ use PHPUnit \TestFixture \MockObject \AnInterface ;
14
+
15
+ final class Issue6095Test extends TestCase
16
+ {
17
+ public function testOne (): void
18
+ {
19
+ $ mock = $ this ->createMock (AnInterface::class);
20
+
21
+ $ mock
22
+ ->expects ($ this ->once ())
23
+ ->method ('doSomething ' );
24
+
25
+ $ mock ->doSomething ();
26
+ $ mock ->doSomething ();
27
+ }
28
+ }
You can’t perform that action at this time.
0 commit comments