Skip to content

Commit a6712d2

Browse files
Merge branch '12.5'
* 12.5: Prepare release Improve message
2 parents 19cca65 + 6dc2e07 commit a6712d2

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/Framework/TestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,8 @@ private function verifyMockObjects(): void
13941394
$this->testValueObjectForEvents,
13951395
sprintf(
13961396
'No expectations were configured for the mock object for %s. ' .
1397-
'You should refactor your test code and use a test stub instead.',
1397+
'Consider refactoring your test code to use a test stub instead. ' .
1398+
'The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.',
13981399
$mockObject['type'],
13991400
),
14001401
);

tests/end-to-end/event/mock-object-created-with-MockBuilder-without-expectations.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Test Suite Started (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest
2525
Test Preparation Started (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest::testOne)
2626
Test Prepared (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest::testOne)
2727
Test Triggered PHPUnit Notice (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest::testOne)
28-
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. You should refactor your test code and use a test stub instead.
28+
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
2929
Test Passed (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest::testOne)
3030
Test Finished (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest::testOne)
3131
Test Suite Finished (TestFixture\PHPUnit\Event\MockBuilderWithoutExpectationsTest, 1 test)

tests/end-to-end/event/mock-object-created-with-createMock-without-expectations.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Test Preparation Started (TestFixture\PHPUnit\Event\CreateMockWithoutExpectation
2626
Test Prepared (TestFixture\PHPUnit\Event\CreateMockWithoutExpectationsTest::testOne)
2727
Mock Object Created (PHPUnit\TestFixture\Event\Example)
2828
Test Triggered PHPUnit Notice (TestFixture\PHPUnit\Event\CreateMockWithoutExpectationsTest::testOne)
29-
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. You should refactor your test code and use a test stub instead.
29+
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
3030
Test Passed (TestFixture\PHPUnit\Event\CreateMockWithoutExpectationsTest::testOne)
3131
Test Finished (TestFixture\PHPUnit\Event\CreateMockWithoutExpectationsTest::testOne)
3232
Test Suite Finished (TestFixture\PHPUnit\Event\CreateMockWithoutExpectationsTest, 1 test)

tests/end-to-end/event/mock-object-created-with-createPartialMock-without-expectations.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Test Preparation Started (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpe
2626
Test Prepared (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpectationsTest::testOne)
2727
Partial Mock Object Created (PHPUnit\TestFixture\Event\Example)
2828
Test Triggered PHPUnit Notice (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpectationsTest::testOne)
29-
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. You should refactor your test code and use a test stub instead.
29+
No expectations were configured for the mock object for PHPUnit\TestFixture\Event\Example. Consider refactoring your test code to use a test stub instead. The #[AllowMockObjectsWithoutExpectations] attribute can be used to opt out of this check.
3030
Test Passed (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpectationsTest::testOne)
3131
Test Finished (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpectationsTest::testOne)
3232
Test Suite Finished (TestFixture\PHPUnit\Event\CreatePartialMockWithoutExpectationsTest, 1 test)

0 commit comments

Comments
 (0)