Skip to content

Commit 11680d6

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents 949b622 + caa3c95 commit 11680d6

File tree

7 files changed

+17
-27
lines changed

7 files changed

+17
-27
lines changed

admin/framework/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.github export-ignore
2+
/.gitattributes export-ignore
3+
/.gitignore export-ignore

tests/system/Commands/SessionsCommandsTest.php

Whitespace-only changes.

tests/system/Cookie/CookieStoreTest.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use CodeIgniter\Cookie\Exceptions\CookieException;
1515
use CodeIgniter\Test\CIUnitTestCase;
1616
use DateTimeImmutable;
17-
use PHPUnit\Framework\MockObject\MockObject;
1817

1918
/**
2019
* @internal
@@ -96,29 +95,6 @@ public function testPutRemoveCookiesInStore(): void
9695
$this->assertFalse($jar->has('dev'));
9796
}
9897

99-
public function testCookieDispatching(): void
100-
{
101-
$cookies = [
102-
'dev' => new Cookie('dev', 'cookie'),
103-
'prod' => new Cookie('prod', 'cookie', ['raw' => true]),
104-
];
105-
106-
$dev = $cookies['dev']->getOptions();
107-
$prod = $cookies['prod']->getOptions();
108-
109-
/**
110-
* @var CookieStore&MockObject $store
111-
*/
112-
$store = $this->getMockBuilder(CookieStore::class)
113-
->setConstructorArgs([$cookies])
114-
->onlyMethods(['setRawCookie', 'setCookie'])
115-
->getMock();
116-
117-
$store->expects($this->once())->method('setRawCookie')->with('prod', 'cookie', $prod);
118-
$store->expects($this->once())->method('setCookie')->with('dev', 'cookie', $dev);
119-
$store->dispatch();
120-
}
121-
12298
public function testCookiesFunction(): void
12399
{
124100
$a = cookies();

user_guide_src/source/tutorial/news_section.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ some additional tools to make working with data simpler. Add the
8888
following code to your model.
8989

9090
.. literalinclude:: news_section/002.php
91+
:lines: 11-18
9192

9293
With this code, you can perform two different queries. You can get all
9394
news records, or get a news item by its slug. You might have
@@ -113,7 +114,7 @@ a new ``News`` controller is defined. Create the new controller at
113114
.. literalinclude:: news_section/003.php
114115

115116
Looking at the code, you may see some similarity with the files we
116-
created earlier. First, it extends a core CodeIgniter class, ``Controller``,
117+
created earlier. First, it extends ``BaseController`` that extends a core CodeIgniter class, ``Controller``,
117118
which provides a couple of helper methods, and makes sure that you have
118119
access to the current ``Request`` and ``Response`` objects, as well as the
119120
``Logger`` class, for saving information to disk.
@@ -143,10 +144,10 @@ and add the next piece of code.
143144

144145
.. literalinclude:: news_section/005.php
145146

146-
.. note:: We are again using using ``esc()`` to help prevent XSS attacks.
147+
.. note:: We are again using using :php:func:`esc()` to help prevent XSS attacks.
147148
But this time we also passed "url" as a second parameter. That's because
148149
attack patterns are different depending on the context in which the output
149-
is used. You can read more about it :doc:`here </general/common_functions>`.
150+
is used.
150151

151152
Here, each news item is looped and displayed to the user. You can see we
152153
wrote our template in PHP mixed with HTML. If you prefer to use a template

user_guide_src/source/tutorial/news_section/002.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<?php
22

3+
namespace App\Models;
4+
5+
use CodeIgniter\Model;
6+
37
class NewsModel extends Model
48
{
9+
protected $table = 'news';
10+
511
public function getNews($slug = false)
612
{
713
if ($slug === false) {

user_guide_src/source/tutorial/news_section/004.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ public function index()
1919
. view('news/overview')
2020
. view('templates/footer');
2121
}
22+
23+
// ...
2224
}

user_guide_src/source/tutorial/news_section/006.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
class News extends BaseController
88
{
9+
// ...
10+
911
public function view($slug = null)
1012
{
1113
$model = model(NewsModel::class);

0 commit comments

Comments
 (0)