Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
os: [ubuntu-latest]
arangodb: ["3.10", 3.11, 3.12]
php: [8.1, 8.2, 8.3]
php: [8.2, 8.3]
stability: [prefer-stable]

name: P${{ matrix.php }} - A${{ matrix.arangodb }} - ${{ matrix.stability }}
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"minimum-stability": "dev",
"prefer-stable" : true,
"prefer-stable": true,
"require": {
"php": "^8.1",
"ext-curl": "*",
Expand All @@ -29,9 +29,9 @@
"mockery/mockery": "^1.4",
"phpmd/phpmd": "^2.9",
"phpstan/phpstan": "^1.0",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.14.8",
"scrutinizer/ocular": "^1.8"
"scrutinizer/ocular": "^1.8",
"pestphp/pest": "^2.2"
},
"autoload": {
"psr-4": {
Expand All @@ -45,11 +45,14 @@
},
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"test": "vendor/bin/phpunit",
"test:coverage": "vendor/bin/phpunit --coverage-clover clover.xml --whitelist src",
"test": "vendor/bin/pest",
"test:coverage": "vendor/bin/pest --coverage-clover clover.xml",
"style": "vendor/bin/pint"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
</include>
</coverage>
<php>
<env name="ARANGODB_VERSION" value="3.8"/>
<env name="ARANGODB_VERSION" value="3.12"/>
</php>
</phpunit>
65 changes: 28 additions & 37 deletions tests/AdminManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,33 @@

declare(strict_types=1);

namespace Tests;

use ArangoClient\Admin\AdminManager;

class AdminManagerTest extends TestCase
{
protected AdminManager $adminManager;

protected function setUp(): void
{
parent::setUp();

$this->adminManager = new AdminManager($this->arangoClient);
}

public function testGetVersion()
{
$result = $this->adminManager->getVersion();

$this->assertSame('arango', $result->server);
$this->assertSame('community', $result->license);
$this->assertIsString($result->version);
}

public function testGetVersionWithDetails()
{
$result = $this->adminManager->getVersion(true);

$this->assertSame('arango', $result->server);
$this->assertSame('community', $result->license);
$this->assertIsString($result->version);
}

public function testGetRunningTransactions()
{
$transactions = $this->adminManager->getRunningTransactions();
$this->assertEmpty($transactions);
}
}
uses(Tests\TestCase::class);

beforeEach(function () {
$this->adminManager = new AdminManager($this->arangoClient);
});


test('get version', function () {
$result = $this->adminManager->getVersion();

expect($result->server)->toBe('arango');
expect($result->license)->toBe('community');
expect($result->version)->toBeString();
});

test('get version with details', function () {
$result = $this->adminManager->getVersion(true);

expect($result->server)->toBe('arango');
expect($result->license)->toBe('community');
expect($result->version)->toBeString();
});

test('get running transactions', function () {
$transactions = $this->adminManager->getRunningTransactions();

expect($transactions)->toBeEmpty();
});
Loading