Skip to content

Commit a793e12

Browse files
committed
docs: update sample code style
1 parent 14dd502 commit a793e12

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

user_guide_src/source/testing/overview/016.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<?php
22

3+
namespace Tests;
4+
5+
use CodeIgniter\HTTP\CURLRequest;
36
use CodeIgniter\Test\CIUnitTestCase;
47
use Config\Services;
58

69
final class SomeTest extends CIUnitTestCase
710
{
811
public function testSomething()
912
{
10-
$curlrequest = $this->getMockBuilder('CodeIgniter\HTTP\CURLRequest')
11-
->setMethods(['request'])
13+
$curlrequest = $this->getMockBuilder(CURLRequest::class)
14+
->onlyMethods(['request'])
1215
->getMock();
1316
Services::injectMock('curlrequest', $curlrequest);
1417

user_guide_src/source/testing/overview/017.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Tests;
44

5+
use App\Models\UserModel;
56
use CodeIgniter\Config\Factories;
67
use CodeIgniter\Test\CIUnitTestCase;
78
use Tests\Support\Mock\MockUserModel;
@@ -13,6 +14,6 @@ protected function setUp(): void
1314
parent::setUp();
1415

1516
$model = new MockUserModel();
16-
Factories::injectMock('models', 'App\Models\UserModel', $model);
17+
Factories::injectMock('models', UserModel::class, $model);
1718
}
1819
}

0 commit comments

Comments
 (0)