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
19 changes: 5 additions & 14 deletions tests/API/ApiNodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\ApiNodes
*/
class ApiNodesTest extends TestCase
{
/** @test */
public function api_nodes_calls_correct_url()
{
$this->assertResponse('GET', 'api-nodes', function (ArkClient $client) {
return $client->apiNodes()->all();
});
}
}
it('calls the correct url for api nodes', function () {
$this->assertResponse('GET', 'api-nodes', function (ArkClient $client) {
return $client->apiNodes()->all();
});
});
19 changes: 5 additions & 14 deletions tests/API/BlockchainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Blockchain
*/
class BlockchainTest extends TestCase
{
/** @test */
public function blockchain´_calls_correct_url()
{
$this->assertResponse('GET', 'blockchain', function (ArkClient $client) {
return $client->blockchain()->blockchain();
});
}
}
it('calls the correct blockchain url', function () {
$this->assertResponse('GET', 'blockchain', function (ArkClient $client) {
return $client->blockchain()->blockchain();
});
});
77 changes: 30 additions & 47 deletions tests/API/BlocksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,33 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Blocks
*/
class BlocksTest extends TestCase
{
/** @test */
public function all_calls_correct_url()
{
$this->assertResponse('GET', 'blocks', function (ArkClient $client) {
return $client->blocks()->all();
});
}

/** @test */
public function get_calls_correct_url()
{
$this->assertResponse('GET', 'blocks/dummy', function (ArkClient $client) {
return $client->blocks()->get('dummy');
});
}

/** @test */
public function first_calls_correct_url()
{
$this->assertResponse('GET', 'blocks/first', function (ArkClient $client) {
return $client->blocks()->first();
});
}

/** @test */
public function last_calls_correct_url()
{
$this->assertResponse('GET', 'blocks/last', function (ArkClient $client) {
return $client->blocks()->last();
});
}

/** @test */
public function transactions_calls_correct_url()
{
$this->assertResponse('GET', 'blocks/dummy/transactions', function (ArkClient $client) {
return $client->blocks()->transactions('dummy');
});
}
}

it('calls correct url for all', function () {
$this->assertResponse('GET', 'blocks', function (ArkClient $client) {
return $client->blocks()->all();
});
});

it('calls correct url for get', function () {
$this->assertResponse('GET', 'blocks/dummy', function (ArkClient $client) {
return $client->blocks()->get('dummy');
});
});

it('calls correct url for first', function () {
$this->assertResponse('GET', 'blocks/first', function (ArkClient $client) {
return $client->blocks()->first();
});
});

it('calls correct url for last', function () {
$this->assertResponse('GET', 'blocks/last', function (ArkClient $client) {
return $client->blocks()->last();
});
});

it('calls correct url for transactions', function () {
$this->assertResponse('GET', 'blocks/dummy/transactions', function (ArkClient $client) {
return $client->blocks()->transactions('dummy');
});
});
19 changes: 5 additions & 14 deletions tests/API/CommitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Commits
*/
class CommitsTest extends TestCase
{
/** @test */
public function get_calls_correct_url()
{
$this->assertResponse('GET', 'commits/1', function (ArkClient $client) {
return $client->commits()->get(1);
});
}
}
it('calls the correct URL for get', function () {
$this->assertResponse('GET', 'commits/1', function (ArkClient $client) {
return $client->commits()->get(1);
});
});
31 changes: 10 additions & 21 deletions tests/API/ContractsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,15 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Contracts
*/
class ContractsTest extends TestCase
{
/** @test */
public function all_calls_correct_url()
{
$this->assertResponse('GET', 'contracts', function (ArkClient $client) {
return $client->contracts()->all();
});
}
it('calls the correct url for all contracts', function () {
$this->assertResponse('GET', 'contracts', function (ArkClient $client) {
return $client->contracts()->all();
});
});

/** @test */
public function abi_calls_correct_url()
{
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (ArkClient $client) {
return $client->contracts()->abi('consensus', 'some-wallet');
});
}
}
it('calls the correct url for abi', function () {
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (ArkClient $client) {
return $client->contracts()->abi('consensus', 'some-wallet');
});
});
37 changes: 14 additions & 23 deletions tests/API/EVMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\EVM
*/
class EVMTest extends TestCase
{
/** @test */
public function eth_call_calls_correct_url()
{
$this->assertResponse(
method: 'POST',
path: 'api/',
callback: function (ArkClient $client) {
return $client->evm()->ethCall([
'from' => '0x1234567890abcdef',
'to' => '0xfedcba0987654321',
'data' => '0xabcdef',
]);
},
expectedApi: 'evm'
);
}
}
it('calls the correct URL for eth_call', function () {
$this->assertResponse(
method: 'POST',
path: 'api/',
callback: function (ArkClient $client) {
return $client->evm()->ethCall([
'from' => '0x1234567890abcdef',
'to' => '0xfedcba0987654321',
'data' => '0xabcdef',
]);
},
expectedApi: 'evm'
);
});
77 changes: 30 additions & 47 deletions tests/API/NodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,33 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Node
*/
class NodeTest extends TestCase
{
/** @test */
public function status_calls_correct_url()
{
$this->assertResponse('GET', 'node/status', function (ArkClient $client) {
return $client->node()->status();
});
}

/** @test */
public function syncing_calls_correct_url()
{
$this->assertResponse('GET', 'node/syncing', function (ArkClient $client) {
return $client->node()->syncing();
});
}

/** @test */
public function configuration_calls_correct_url()
{
$this->assertResponse('GET', 'node/configuration', function (ArkClient $client) {
return $client->node()->configuration();
});
}

/** @test */
public function crypto_calls_correct_url()
{
$this->assertResponse('GET', 'node/configuration/crypto', function (ArkClient $client) {
return $client->node()->crypto();
});
}

/** @test */
public function fees_calls_correct_url()
{
$this->assertResponse('GET', 'node/fees', function (ArkClient $client) {
return $client->node()->fees();
});
}
}

it('calls the correct url for status', function () {
$this->assertResponse('GET', 'node/status', function (ArkClient $client) {
return $client->node()->status();
});
});

it('calls the correct url for syncing', function () {
$this->assertResponse('GET', 'node/syncing', function (ArkClient $client) {
return $client->node()->syncing();
});
});

it('calls the correct url for configuration', function () {
$this->assertResponse('GET', 'node/configuration', function (ArkClient $client) {
return $client->node()->configuration();
});
});

it('calls the correct url for crypto', function () {
$this->assertResponse('GET', 'node/configuration/crypto', function (ArkClient $client) {
return $client->node()->crypto();
});
});

it('calls the correct url for fees', function () {
$this->assertResponse('GET', 'node/fees', function (ArkClient $client) {
return $client->node()->fees();
});
});
31 changes: 10 additions & 21 deletions tests/API/PeersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,15 @@
namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Tests\Client\TestCase;

/**
* @covers \ArkEcosystem\Client\API\Peers
*/
class PeersTest extends TestCase
{
/** @test */
public function all_calls_correct_url()
{
$this->assertResponse('GET', 'peers', function (ArkClient $client) {
return $client->peers()->all();
});
}
it('calls correct url for all', function () {
$this->assertResponse('GET', 'peers', function (ArkClient $client) {
return $client->peers()->all();
});
});

/** @test */
public function get_calls_correct_url()
{
$this->assertResponse('GET', 'peers/dummy', function (ArkClient $client) {
return $client->peers()->get('dummy');
});
}
}
it('calls correct url for get', function () {
$this->assertResponse('GET', 'peers/dummy', function (ArkClient $client) {
return $client->peers()->get('dummy');
});
});
Loading