Skip to content

Commit 862bc6d

Browse files
committed
allow php 8 and support phpunit 9
1 parent 9847773 commit 862bc6d

File tree

72 files changed

+319
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+319
-265
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
}
2828
],
2929
"require": {
30-
"php": "^5.6|^7.0",
30+
"php": "^7.1 || ^8.0",
3131
"phpcr/phpcr-implementation": "2.1.*",
32-
"phpunit/phpunit": "^5.7 || ^6.4 || ^7.0"
32+
"phpunit/phpunit": "^7.0 || ^8.0 || ^9.0"
3333
},
3434
"autoload": {
3535
"psr-4": {

inc/AbstractLoader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,11 @@ public function doesSessionLastModified()
255255
*/
256256
public function getTestSupported($chapter, $case, $name)
257257
{
258-
return !(in_array($chapter, $this->unsupportedChapters)
258+
return !(
259+
in_array($chapter, $this->unsupportedChapters)
259260
|| in_array($case, $this->unsupportedCases)
260261
|| in_array($name, $this->unsupportedTests)
261-
);
262+
);
262263
}
263264

264265
/**

inc/BaseCase.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ abstract class BaseCase extends TestCase
9696
*
9797
* @see initProperties()
9898
*/
99-
public static function setupBeforeClass($fixtures = 'general/base')
99+
public static function setupBeforeClass($fixtures = 'general/base'): void
100100
{
101101
self::$loader = ImplementationLoader::getInstance();
102102

@@ -120,7 +120,7 @@ public static function setupBeforeClass($fixtures = 'general/base')
120120
self::$staticSharedFixture['additionalSession'] = self::$loader->getAdditionalSession();
121121
}
122122

123-
protected function setUp()
123+
protected function setUp(): void
124124
{
125125
$fqn = get_called_class();
126126
$parts = explode('\\', $fqn);
@@ -144,7 +144,7 @@ protected function setUp()
144144
$this->initProperties();
145145
}
146146

147-
public static function tearDownAfterClass()
147+
public static function tearDownAfterClass(): void
148148
{
149149
if (isset(self::$staticSharedFixture['session'])) {
150150
self::$staticSharedFixture['session']->logout();
@@ -278,7 +278,8 @@ protected function assertSimilarDateTime($expected, $data)
278278
{
279279
$this->assertInstanceOf(DateTime::class, $expected);
280280
$this->assertInstanceOf(DateTime::class, $data);
281-
$this->assertTrue(abs($expected->getTimestamp() - $data->getTimestamp()) <= 3,
281+
$this->assertTrue(
282+
abs($expected->getTimestamp() - $data->getTimestamp()) <= 3,
282283
$data->format('c').' is not close to the expected '.$expected->format('c')
283284
);
284285
}
@@ -290,7 +291,7 @@ protected function assertSimilarDateTime($expected, $data)
290291
*
291292
* @return bool True if the test can be done. Otherwise the test is skipped.
292293
*/
293-
protected function skipIfNotSupported($descriptor)
294+
protected function skipIfNotSupported($descriptor): bool
294295
{
295296
if (false === $this->session->getRepository()->getDescriptor($descriptor)) {
296297
$this->markTestSkipped('Descriptor "'.$descriptor.'" not supported');

tests/Connecting/RepositoryDescriptorsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class RepositoryDescriptorsTest extends BaseCase
1717
{
18-
public static function setupBeforeClass($fixtures = false)
18+
public static function setupBeforeClass($fixtures = false): void
1919
{
2020
// Don't care about fixtures
2121
parent::setupBeforeClass($fixtures);
@@ -41,7 +41,7 @@ public function testDescriptorKeys()
4141
{
4242
$rep = self::$loader->getRepository();
4343
$keys = $rep->getDescriptorKeys();
44-
$this->assertInternalType('array', $keys);
44+
$this->assertIsArray($keys);
4545
$this->assertNotEmpty($keys);
4646
foreach ($this->expectedDescriptors as $descriptor) {
4747
$this->assertContains($descriptor, $keys);

tests/Connecting/RepositoryFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
class RepositoryFactoryTest extends BaseCase
1919
{
20-
public static function setupBeforeClass($fixtures = false)
20+
public static function setupBeforeClass($fixtures = false): void
2121
{
2222
// Don't care about fixtures
2323
parent::setupBeforeClass($fixtures);

tests/Connecting/RepositoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class RepositoryTest extends BaseCase
2222
{
23-
public static function setupBeforeClass($fixtures = null)
23+
public static function setupBeforeClass($fixtures = null): void
2424
{
2525
// Don't care about fixtures
2626
parent::setupBeforeClass($fixtures);

tests/Connecting/SessionReadMethodsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testGetAttributeNames()
5454
$cr->setAttribute('foo', 'bar');
5555
$session = $this->assertSession($cr);
5656
$attrs = $session->getAttributeNames();
57-
$this->assertInternalType('array', $attrs);
57+
$this->assertIsArray($attrs);
5858
$this->assertContains('foo', $attrs);
5959
}
6060

tests/Connecting/SimpleCredentialsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class SimpleCredentialsTest extends BaseCase
2222
{
23-
public static function setupBeforeClass($fixtures = false)
23+
public static function setupBeforeClass($fixtures = false): void
2424
{
2525
// Don't care about fixtures
2626
parent::setupBeforeClass($fixtures);
@@ -67,7 +67,7 @@ public function testAttributes()
6767
$cr->setAttribute($attrName, $attrValue);
6868
$this->assertEquals($attrValue, $cr->getAttribute($attrName));
6969
$attrs = $cr->getAttributeNames();
70-
$this->assertInternalType('array', $attrs);
70+
$this->assertIsArray($attrs);
7171
$this->assertContains($attrName, $attrs);
7272
$cr->removeAttribute($attrName);
7373
$this->assertNull($cr->getAttribute($attrName));

tests/Connecting/WorkspaceReadMethodsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class WorkspaceReadMethodsTest extends BaseCase
3535

3636
//4.5 Workspace Read Methods
3737

38-
public function setUp()
38+
public function setUp(): void
3939
{
4040
parent::setUp();
4141

@@ -98,7 +98,7 @@ public function testGetAccessibleWorkspaceNames()
9898
{
9999
$names = $this->workspace->getAccessibleWorkspaceNames();
100100

101-
$this->assertInternalType('array', $names);
101+
$this->assertIsArray($names);
102102
$this->assertContains(self::$loader->getWorkspaceName(), $names);
103103
}
104104

tests/Export/ExportRepositoryContentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
//7 Export Repository Content
2222
class ExportRepositoryContentTest extends BaseCase
2323
{
24-
public static function setupBeforeClass($fixtures = '07_Export/systemview')
24+
public static function setupBeforeClass($fixtures = '07_Export/systemview'): void
2525
{
2626
parent::setupBeforeClass($fixtures);
2727
}

0 commit comments

Comments
 (0)