Skip to content

Commit 16d2d87

Browse files
committed
Use Laminas and PHP ^7.2
1 parent c5a6f9a commit 16d2d87

File tree

6 files changed

+36
-44
lines changed

6 files changed

+36
-44
lines changed

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ env:
77
matrix:
88
fast_finish: true
99
include:
10-
- php: 7.1
11-
env:
12-
- DEPENDENCIES=""
13-
- ARANGODB_VERSION=3.3.25
1410
- php: 7.2
1511
env:
1612
- DEPENDENCIES=""

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@
1515
"sort-packages": true
1616
},
1717
"require": {
18-
"php": "^7.1",
18+
"php": "^7.2",
1919
"ext-json": "*",
2020
"fig/http-message-util": "^1.1.2",
2121
"psr/http-client": "^1.0",
2222
"psr/http-factory": "^1.0",
2323
"psr/http-message": "^1.0"
2424
},
2525
"require-dev": {
26-
"infection/infection": "^0.16.3",
26+
"infection/infection": "^0.16.3 || ^0.15.3",
2727
"malukenho/docheader": "^0.1.8",
2828
"php-coveralls/php-coveralls": "^2.1",
2929
"phpstan/phpstan": "^0.12.29",
3030
"phpstan/phpstan-strict-rules": "^0.12.2",
31-
"phpunit/phpunit": "^9.2.3 || ^7.5.8",
31+
"phpunit/phpunit": "^9.2.3 || ^8.5",
3232
"roave/security-advisories": "dev-master",
3333
"squizlabs/php_codesniffer": "^3.5.5",
34-
"zendframework/zend-diactoros": "^2.1"
34+
"laminas/laminas-diactoros": "^2.3.0"
3535
},
3636
"autoload": {
3737
"psr-4": {

test/Http/BatchResultTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class BatchResultTest extends TestCase
3030
protected function setUp(): void
3131
{
3232
parent::setUp();
33-
$this->streamFactory = TestUtil::getStreamFactory(true);
33+
$this->streamFactory = TestUtil::getStreamFactory();
3434
}
3535

3636
/**

test/Http/TransactionalClientTest.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ public function it_updates_document(): void
162162

163163
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
164164

165-
$this->arrayHasKey('result', $data);
166-
$this->arrayHasKey('rId0', $data['result']);
167-
$this->arrayHasKey('rId1', $data['result']);
165+
$this->assertTrue(isset($data['result']));
166+
$this->assertTrue(isset($data['result']['rId0']));
167+
$this->assertTrue(isset($data['result']['rId1']));
168168
}
169169

170170
/**
@@ -198,9 +198,9 @@ public function it_updates_documents(): void
198198

199199
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
200200

201-
$this->arrayHasKey('result', $data);
202-
$this->arrayHasKey('rId0', $data['result']);
203-
$this->arrayHasKey('rId1', $data['result']);
201+
$this->assertTrue(isset($data['result']));
202+
$this->assertTrue(isset($data['result']['rId0']));
203+
$this->assertTrue(isset($data['result']['rId1']));
204204
}
205205

206206
/**
@@ -232,9 +232,9 @@ public function it_replaces_document(): void
232232

233233
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
234234

235-
$this->arrayHasKey('result', $data);
236-
$this->arrayHasKey('rId0', $data['result']);
237-
$this->arrayHasKey('rId1', $data['result']);
235+
$this->assertTrue(isset($data['result']));
236+
$this->assertTrue(isset($data['result']['rId0']));
237+
$this->assertTrue(isset($data['result']['rId1']));
238238
}
239239

240240
/**
@@ -268,9 +268,9 @@ public function it_replaces_documents(): void
268268

269269
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
270270

271-
$this->arrayHasKey('result', $data);
272-
$this->arrayHasKey('rId0', $data['result']);
273-
$this->arrayHasKey('rId1', $data['result']);
271+
$this->assertTrue(isset($data['result']));
272+
$this->assertTrue(isset($data['result']['rId0']));
273+
$this->assertTrue(isset($data['result']['rId1']));
274274
}
275275

276276
/**
@@ -324,9 +324,9 @@ public function it_inserts_documents_in_different_collections(): void
324324

325325
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
326326

327-
$this->arrayHasKey('result', $data);
328-
$this->arrayHasKey('rId0', $data['result']);
329-
$this->arrayHasKey('rId1', $data['result']);
327+
$this->assertTrue(isset($data['result']));
328+
$this->assertTrue(isset($data['result']['rId0']));
329+
$this->assertTrue(isset($data['result']['rId1']));
330330
$this->arrayHasKey('rId2', $data['result']);
331331

332332
$response = $this->client->sendRequest(
@@ -409,10 +409,10 @@ public function contentId(): ?string
409409

410410
$this->assertEquals(StatusCodeInterface::STATUS_OK, $response->getStatusCode());
411411

412-
$this->arrayHasKey('result', $data);
413-
$this->arrayHasKey('rId0', $data['result']);
414-
$this->arrayHasKey('rId1', $data['result']);
415-
$this->arrayHasKey('rId2', $data['result']);
412+
$this->assertTrue(isset($data['result']));
413+
$this->assertTrue(isset($data['result']['rId0']));
414+
$this->assertTrue(isset($data['result']['rId2']));
415+
$this->assertTrue(isset($data['result']['rIdtransaction']));
416416

417417
$this->assertSame(1, $guard->counter);
418418
$this->assertSame('xyz', $guard->name);

test/TestUtil.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
use ArangoDb\Exception\ArangoDbException;
1616
use ArangoDb\Statement\ArrayStreamHandlerFactory;
1717
use ArangoDb\Statement\StreamHandlerFactoryInterface;
18-
use ArangoDb\Statement\VpackStreamHandler;
19-
use ArangoDb\Statement\VpackStreamHandlerFactory;
2018
use ArangoDb\Type\Database;
2119
use ArangoDb\Http\ClientOptions;
2220
use ArangoDb\Http\Url;
@@ -28,12 +26,10 @@
2826
use Psr\Http\Message\ResponseFactoryInterface;
2927
use Psr\Http\Message\ResponseInterface;
3028
use Psr\Http\Message\StreamFactoryInterface;
31-
use Psr\Http\Message\StreamInterface;
32-
use Zend\Diactoros\Request;
33-
use Zend\Diactoros\Response;
34-
use Zend\Diactoros\Stream;
35-
use Velocypack\Vpack;
36-
use Zend\Diactoros\StreamFactory;
29+
use Laminas\Diactoros\Request;
30+
use Laminas\Diactoros\Response;
31+
use Laminas\Diactoros\StreamFactory;
32+
use RuntimeException;
3733

3834
final class TestUtil
3935
{
@@ -96,7 +92,7 @@ public static function createDatabase(): void
9692
$params = self::getConnectionParams();
9793

9894
if ($params[ClientOptions::OPTION_DATABASE] === '_system') {
99-
throw new \RuntimeException('"_system" database can not be created. Choose another database for tests.');
95+
throw new RuntimeException('"_system" database can not be created. Choose another database for tests.');
10096
}
10197

10298
$params[ClientOptions::OPTION_DATABASE] = '_system';
@@ -108,7 +104,7 @@ public static function createDatabase(): void
108104

109105
if ($response->getStatusCode() !== StatusCodeInterface::STATUS_CREATED) {
110106
self::dropDatabase();
111-
throw new \RuntimeException($response->getBody()->getContents());
107+
throw new RuntimeException($response->getBody()->getContents());
112108
}
113109
}
114110

@@ -117,7 +113,7 @@ public static function dropDatabase(): void
117113
$params = self::getConnectionParams();
118114

119115
if ($params[ClientOptions::OPTION_DATABASE] === '_system') {
120-
throw new \RuntimeException('"_system" database can not be dropped. Choose another database for tests.');
116+
throw new RuntimeException('"_system" database can not be dropped. Choose another database for tests.');
121117
}
122118

123119
$params[ClientOptions::OPTION_DATABASE] = '_system';
@@ -143,7 +139,7 @@ public static function getResponseContent(ResponseInterface $response): array
143139
public static function getDatabaseName(): string
144140
{
145141
if (! self::hasRequiredConnectionParams()) {
146-
throw new \RuntimeException('No connection params given');
142+
throw new RuntimeException('No connection params given');
147143
}
148144

149145
return getenv('arangodb_dbname');
@@ -152,7 +148,7 @@ public static function getDatabaseName(): string
152148
public static function getConnectionParams(): array
153149
{
154150
if (! self::hasRequiredConnectionParams()) {
155-
throw new \RuntimeException('No connection params given');
151+
throw new RuntimeException('No connection params given');
156152
}
157153

158154
return self::getSpecifiedConnectionParams();

test/Type/DocumentTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function it_inserts_documents(): array
7474
$this->assertCount(3, $data);
7575

7676
return array_map(
77-
function (array $doc) {
77+
static function (array $doc) {
7878
return $doc['_id'];
7979
},
8080
$data
@@ -174,7 +174,7 @@ public function it_updates_documents(): void
174174
$this->assertEquals(StatusCodeInterface::STATUS_ACCEPTED, $response->getStatusCode());
175175

176176
$data = array_map(
177-
function (array $doc) {
177+
static function (array $doc) {
178178
$newDoc = $doc['new'];
179179
$newDoc['test'] = 'more valid';
180180
return $newDoc;
@@ -246,7 +246,7 @@ public function it_replaces_documents(): void
246246
$this->assertEquals(StatusCodeInterface::STATUS_ACCEPTED, $response->getStatusCode());
247247

248248
$data = array_map(
249-
function (array $doc) {
249+
static function (array $doc) {
250250
$newDoc = $doc['new'];
251251
unset($newDoc['test']);
252252
$newDoc['other'] = 'more valid';

0 commit comments

Comments
 (0)