Skip to content

Commit 729f3f1

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents a046931 + 253133b commit 729f3f1

File tree

7 files changed

+25
-26
lines changed

7 files changed

+25
-26
lines changed

.github/workflows/test-phpstan.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,14 @@ jobs:
3333
runs-on: ubuntu-20.04
3434
strategy:
3535
fail-fast: false
36-
matrix:
37-
php-versions: ['8.0', '8.1']
3836
steps:
3937
- name: Checkout
4038
uses: actions/checkout@v3
4139

4240
- name: Setup PHP
4341
uses: shivammathur/setup-php@v2
4442
with:
45-
php-version: ${{ matrix.php-versions }}
43+
php-version: '8.1'
4644
extensions: intl
4745

4846
- name: Use latest Composer

phpstan-baseline.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ parameters:
261261
path: system/Database/MySQLi/Result.php
262262

263263
-
264-
message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#"
264+
message: "#^Strict comparison using \\=\\=\\= between array<string, int|string|null> and false will always evaluate to false\\.$#"
265265
count: 1
266266
path: system/Database/Postgre/Connection.php
267267

phpstan.neon.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ includes:
1616
- phpstan-baseline.neon.dist
1717

1818
parameters:
19-
phpVersion: 80000
19+
phpVersion: 80100
2020
tmpDir: build/phpstan
2121
level: 5
2222
paths:

tests/system/HTTP/MessageTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ public function testAppendBody()
154154
{
155155
$this->message->setBody('moo');
156156

157-
$this->message->appendBody('\n');
157+
$this->message->appendBody("\n");
158158

159-
$this->assertSame('moo\n', $this->message->getBody());
159+
$this->assertSame("moo\n", $this->message->getBody());
160160
}
161161

162162
public function testSetHeaderReplacingHeader()

tests/system/HTTP/ResponseTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,10 @@ public function testSetLastModifiedWithDateTimeObject()
243243
{
244244
$response = new Response(new App());
245245

246-
$response->setLastModified(DateTime::createFromFormat('Y-m-d', '2000-03-10'));
246+
$datetime = DateTime::createFromFormat('Y-m-d', '2000-03-10');
247+
$response->setLastModified($datetime);
247248

248-
$date = DateTime::createFromFormat('Y-m-d', '2000-03-10');
249+
$date = clone $datetime;
249250
$date->setTimezone(new DateTimeZone('UTC'));
250251

251252
$header = $response->getHeaderLine('Last-Modified');

tests/system/HTTP/URITest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -863,56 +863,56 @@ public function testSetBadSegmentSilent()
863863

864864
public function testBasedNoIndex()
865865
{
866-
$this->resetServices();
867-
868866
$_SERVER['HTTP_HOST'] = 'example.com';
869867
$_SERVER['REQUEST_URI'] = '/ci/v4/controller/method';
870868

869+
$this->resetServices();
870+
871871
$config = new App();
872-
$config->baseURL = 'http://example.com/ci/v4';
873-
$config->indexPage = 'index.php';
874-
$request = Services::request($config);
875-
$request->uri = new URI('http://example.com/ci/v4/controller/method');
872+
$config->baseURL = 'http://example.com/ci/v4/';
873+
$config->indexPage = '';
874+
Factories::injectMock('config', 'App', $config);
876875

876+
$request = Services::request($config);
877877
Services::injectMock('request', $request);
878878

879879
// going through request
880880
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $request->getUri());
881-
$this->assertSame('/ci/v4/controller/method', $request->getUri()->getPath());
881+
$this->assertSame('ci/v4/controller/method', $request->getUri()->getPath());
882882

883883
// standalone
884884
$uri = new URI('http://example.com/ci/v4/controller/method');
885885
$this->assertSame('http://example.com/ci/v4/controller/method', (string) $uri);
886886
$this->assertSame('/ci/v4/controller/method', $uri->getPath());
887887

888-
$this->assertSame($uri->getPath(), $request->getUri()->getPath());
888+
$this->assertSame($uri->getPath(), '/' . $request->getUri()->getPath());
889889
}
890890

891891
public function testBasedWithIndex()
892892
{
893-
$this->resetServices();
894-
895893
$_SERVER['HTTP_HOST'] = 'example.com';
896894
$_SERVER['REQUEST_URI'] = '/ci/v4/index.php/controller/method';
897895

896+
$this->resetServices();
897+
898898
$config = new App();
899-
$config->baseURL = 'http://example.com/ci/v4';
899+
$config->baseURL = 'http://example.com/ci/v4/';
900900
$config->indexPage = 'index.php';
901-
$request = Services::request($config);
902-
$request->uri = new URI('http://example.com/ci/v4/index.php/controller/method');
901+
Factories::injectMock('config', 'App', $config);
903902

903+
$request = Services::request($config);
904904
Services::injectMock('request', $request);
905905

906906
// going through request
907907
$this->assertSame('http://example.com/ci/v4/index.php/controller/method', (string) $request->getUri());
908-
$this->assertSame('/ci/v4/index.php/controller/method', $request->getUri()->getPath());
908+
$this->assertSame('ci/v4/index.php/controller/method', $request->getUri()->getPath());
909909

910910
// standalone
911911
$uri = new URI('http://example.com/ci/v4/index.php/controller/method');
912912
$this->assertSame('http://example.com/ci/v4/index.php/controller/method', (string) $uri);
913913
$this->assertSame('/ci/v4/index.php/controller/method', $uri->getPath());
914914

915-
$this->assertSame($uri->getPath(), $request->getUri()->getPath());
915+
$this->assertSame($uri->getPath(), '/' . $request->getUri()->getPath());
916916
}
917917

918918
public function testForceGlobalSecureRequests()

tests/system/Pager/PagerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ public function testBasedURI()
467467
$config = new App();
468468
$config->baseURL = 'http://example.com/ci/v4/';
469469
$config->indexPage = 'fc.php';
470-
$request = Services::request($config);
471-
$request->uri = new URI('http://example.com/ci/v4/x/y');
470+
Factories::injectMock('config', 'App', $config);
472471

472+
$request = Services::request($config);
473473
Services::injectMock('request', $request);
474474

475475
$this->config = new PagerConfig();

0 commit comments

Comments
 (0)