Skip to content
Snippets Groups Projects
Commit c992eb8b authored by Brad Jones's avatar Brad Jones
Browse files

Issue #3253976 by bradjones1: Address test deprecation notices

parent 2779a20c
No related branches found
No related tags found
No related merge requests found
variables:
PHP_TAG: "8.1"
include:
- project: 'drupalspoons/composer-plugin'
# Best practice is to pin to a tag or a SHA1. https://docs.gitlab.com/ee/ci/yaml/#includefile
ref: '2.1.0'
file: 'templates/.gitlab-ci.yml'
composer_node:
stage: build
variables:
DRUPAL_CORE_CONSTRAINT: ^9.3
......@@ -9,6 +9,9 @@
"drupal/consumers": "^1.2",
"php": ">=7.4"
},
"require-dev": {
"phpspec/prophecy-phpunit": "^2"
},
"license": "GPL-2.0+",
"authors": [
{
......
......@@ -19,7 +19,7 @@ class DisallowSimpleOauthRequests implements SimpleOauthRequestPolicyInterface {
// We have to perform also an exact match, as if no token is provided then
// the LWS might be stripped, but we still have to detect this as OAuth2
// authentication. See: https://www.ietf.org/rfc/rfc2616.txt
$auth_header = trim($request->headers->get('Authorization', '', TRUE));
$auth_header = trim($request->headers->get('Authorization') ?? '');
return (strpos($auth_header, 'Bearer ') !== FALSE) || ($auth_header === 'Bearer');
}
......
......@@ -24,7 +24,7 @@ class EntityCollectorTest extends UnitTestCase {
public function testCollect() {
list($expired_collector, $query,) = $this->buildProphecies();
$query->condition('expire', 42, '<')->shouldBeCalledTimes(1);
$this->assertArrayEquals([1, 52], array_map(function ($entity) {
$this->assertEquals([1, 52], array_map(function ($entity) {
return $entity->id();
}, $expired_collector->collect()));
}
......@@ -38,7 +38,7 @@ class EntityCollectorTest extends UnitTestCase {
$client->id()->willReturn(35);
$query->condition('client', 35)->shouldBeCalledTimes(1);
$tokens = $expired_collector->collectForClient($client->reveal());
$this->assertArrayEquals([1, 52], array_map(function ($entity) {
$this->assertEquals([1, 52], array_map(function ($entity) {
return $entity->id();
}, $tokens));
}
......@@ -57,7 +57,7 @@ class EntityCollectorTest extends UnitTestCase {
])->shouldBeCalledTimes(1);
$token_query->condition('client', 6)->shouldBeCalledTimes(1);
$tokens = $expired_collector->collectForAccount($account->reveal());
$this->assertArrayEquals([1, 52], array_map(function ($entity) {
$this->assertEquals([1, 52], array_map(function ($entity) {
return $entity->id();
}, $tokens));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment