Skip to content

Commit f5adfdd

Browse files
committed
Fix E_DEPRECATED messages when running against PHP 8.5
Fixes #448
1 parent 73ab961 commit f5adfdd

4 files changed

Lines changed: 34 additions & 31 deletions

File tree

source/CAS/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ public function markAuthenticationCall ($auth)
788788
'file' => $dbg[1]['file'],
789789
'line' => $dbg[1]['line'],
790790
'method' => $dbg[1]['class'] . '::' . $dbg[1]['function'],
791-
'result' => (boolean)$auth
791+
'result' => (bool)$auth
792792
);
793793
}
794794
private $_authentication_caller;
@@ -3166,7 +3166,7 @@ public function getProxiedService ($type)
31663166
$proxiedService->setCasClient($this);
31673167
}
31683168
return $proxiedService;
3169-
case PHPCAS_PROXIED_SERVICE_IMAP;
3169+
case PHPCAS_PROXIED_SERVICE_IMAP:
31703170
$proxiedService = new CAS_ProxiedService_Imap($this->_getUser());
31713171
if ($proxiedService instanceof CAS_ProxiedService_Testable) {
31723172
$proxiedService->setCasClient($this);

test/CAS/Tests/CallbackTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ public static function setUpBeforeClass(): void
7373

7474
$class = new \ReflectionClass('\CAS_Client');
7575
$method = $class->getMethod('isXmlResponse');
76-
$method->setAccessible(true);
76+
if (PHP_VERSION_ID < 80100) {
77+
$method->setAccessible(true);
78+
}
7779
self::$isXmlResponse = $method;
7880
}
7981

@@ -94,7 +96,7 @@ public function testAcceptXML($accept, $expected)
9496
$this->assertEquals($expected, self::$isXmlResponse->invokeArgs(self::$client, array()), $accept);
9597
}
9698

97-
public function acceptXMLDataProvider()
99+
public static function acceptXMLDataProvider()
98100
{
99101
return array(
100102
array(false, false),

test/CAS/Tests/CookieJarTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,8 @@ class CookieJarTest extends TestCase
8181
*/
8282
protected $object;
8383

84-
/**
85-
* Sets up the fixture, for example, opens a network connection.
86-
* This method is called before a test is executed.
87-
*
88-
* @return void
89-
*/
90-
protected function setUp(): void
91-
{
92-
$this->cookieArray = array();
93-
$this->object = new CookieJarExposed($this->cookieArray);
94-
95-
$this->serviceUrl_1 = 'http://service.example.com/lookup/?action=search&query=username';
96-
$this->responseHeaders_1 = array('HTTP/1.1 302 Found',
84+
protected $serviceUrl_1 = 'http://service.example.com/lookup/?action=search&query=username';
85+
protected $responseHeaders_1 = array('HTTP/1.1 302 Found',
9786
'Date: Tue, 07 Sep 2010 17:51:54 GMT',
9887
'Server: Apache/2.2.3 (Red Hat)', 'X-Powered-By: PHP/5.1.6',
9988
'Set-Cookie: SID=k1jut1r1bqrumpei837kk4jks0; path=/',
@@ -104,8 +93,19 @@ protected function setUp(): void
10493
'Content-Length: 525', 'Connection: close',
10594
'Content-Type: text/html; charset=UTF-8',
10695
);
107-
$this->serviceUrl_1b = 'http://service.example.com/lookup/?action=search&query=another_username';
108-
$this->serviceUrl_1c = 'http://service.example.com/make_changes.php';
96+
protected $serviceUrl_1b = 'http://service.example.com/lookup/?action=search&query=another_username';
97+
protected $serviceUrl_1c = 'http://service.example.com/make_changes.php';
98+
99+
/**
100+
* Sets up the fixture, for example, opens a network connection.
101+
* This method is called before a test is executed.
102+
*
103+
* @return void
104+
*/
105+
protected function setUp(): void
106+
{
107+
$cookieArray = array();
108+
$this->object = new CookieJarExposed($cookieArray);
109109

110110
// Verify that there are no cookies to start.
111111
$this->assertEquals(

test/CAS/Tests/ProxyChainsTest.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,27 +48,28 @@ class ProxyChainsTest extends TestCase
4848
*/
4949
protected $object;
5050

51-
/**
52-
* Sets up the fixture, for example, opens a network connection.
53-
* This method is called before a test is executed.
54-
*/
55-
protected function setUp(): void
56-
{
57-
$this->object = new \CAS_ProxyChain_AllowedList;
58-
$this->list_size_0 = array();
59-
$this->list_size_1 = array('https://service1.example.com/rest',);
60-
$this->list_size_2 = array('https://service1.example.com/rest',
51+
protected $list_size_0 = array();
52+
protected $list_size_1 = array('https://service1.example.com/rest',);
53+
protected $list_size_2 = array('https://service1.example.com/rest',
6154
'http://service2.example.com/my/path',
6255
);
63-
$this->list_size_3 = array('https://service1.example.com/rest',
56+
protected $list_size_3 = array('https://service1.example.com/rest',
6457
'http://service2.example.com/my/path',
6558
'http://service3.example.com/other/',
6659
);
67-
$this->list_size_4 = array('https://service1.example.com/rest',
60+
protected $list_size_4 = array('https://service1.example.com/rest',
6861
'http://service2.example.com/my/path',
6962
'http://service3.example.com/other/',
7063
'https://service4.example.com/',
7164
);
65+
66+
/**
67+
* Sets up the fixture, for example, opens a network connection.
68+
* This method is called before a test is executed.
69+
*/
70+
protected function setUp(): void
71+
{
72+
$this->object = new \CAS_ProxyChain_AllowedList;
7273
}
7374

7475
/**

0 commit comments

Comments
 (0)