Skip to content

Commit 0487495

Browse files
committed
Simplify mocks used
1 parent 39cfd81 commit 0487495

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tests/system/CommonFunctionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function testRedirectReturnsRedirectResponse()
111111
\CodeIgniter\Services::injectMock('routes', $routes);
112112

113113
$routes->add('home/base', 'Controller::index', ['as' => 'base']);
114-
$response->method('redirect')->will($this->returnArgument(0));
114+
$response->method('redirect')->willReturnArgument(0);
115115

116116
$this->assertInstanceOf(RedirectResponse::class, redirect('base'));
117117
}

utils/PhpCsFixer/CodeIgniter4.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ public function __construct()
150150
'php_unit_fqcn_annotation' => true,
151151
'php_unit_internal_class' => ['types' => ['normal', 'final']],
152152
'php_unit_method_casing' => ['case' => 'camel_case'],
153+
'php_unit_mock' => ['target' => 'newest'],
154+
'php_unit_mock_short_will_return' => true,
153155
'php_unit_no_expectation_annotation' => [
154156
'target' => 'newest',
155157
'use_class_const' => true,

0 commit comments

Comments
 (0)