Skip to content

Commit a4e6892

Browse files
datedfaustbrian
authored andcommitted
refactor: remove version remains (#59)
1 parent bcfc987 commit a4e6892

12 files changed

+37
-36
lines changed

.codacy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
exclude_paths:
3+
- 'tests/**'
4+
- '*.md'

src/Connection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public function __construct(array $config, HandlerStack $handler = null)
4444
'base_uri' => $config['host'],
4545
'headers' => [
4646
'Content-Type' => 'application/json',
47-
'API-Version' => 2,
4847
],
4948
];
5049

tests/API/BlocksTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ class BlocksTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'blocks', function ($connection) {
29+
$this->assertResponse('GET', 'blocks', function ($connection) {
3030
return $connection->blocks()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function show_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'blocks/dummy', function ($connection) {
37+
$this->assertResponse('GET', 'blocks/dummy', function ($connection) {
3838
return $connection->blocks()->show('dummy');
3939
});
4040
}
4141

4242
/** @test */
4343
public function transactions_calls_correct_url()
4444
{
45-
$this->assertResponse(2, 'GET', 'blocks/dummy/transactions', function ($connection) {
45+
$this->assertResponse('GET', 'blocks/dummy/transactions', function ($connection) {
4646
return $connection->blocks()->transactions('dummy');
4747
});
4848
}
4949

5050
/** @test */
5151
public function search_calls_correct_url()
5252
{
53-
$this->assertResponse(2, 'POST', 'blocks/search', function ($connection) {
53+
$this->assertResponse('POST', 'blocks/search', function ($connection) {
5454
return $connection->blocks()->search(['address' => 'dummy']);
5555
});
5656
}

tests/API/DelegatesTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ class DelegatesTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'delegates', function ($connection) {
29+
$this->assertResponse('GET', 'delegates', function ($connection) {
3030
return $connection->delegates()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function show_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'delegates/dummy', function ($connection) {
37+
$this->assertResponse('GET', 'delegates/dummy', function ($connection) {
3838
return $connection->delegates()->show('dummy');
3939
});
4040
}
4141

4242
/** @test */
4343
public function blocks_calls_correct_url()
4444
{
45-
$this->assertResponse(2, 'GET', 'delegates/dummy/blocks', function ($connection) {
45+
$this->assertResponse('GET', 'delegates/dummy/blocks', function ($connection) {
4646
return $connection->delegates()->blocks('dummy');
4747
});
4848
}
4949

5050
/** @test */
5151
public function voters_calls_correct_url()
5252
{
53-
$this->assertResponse(2, 'GET', 'delegates/dummy/voters', function ($connection) {
53+
$this->assertResponse('GET', 'delegates/dummy/voters', function ($connection) {
5454
return $connection->delegates()->voters('dummy');
5555
});
5656
}

tests/API/NodeTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,31 @@ class NodeTest extends TestCase
2626
/** @test */
2727
public function status_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'node/status', function ($connection) {
29+
$this->assertResponse('GET', 'node/status', function ($connection) {
3030
return $connection->node()->status();
3131
});
3232
}
3333

3434
/** @test */
3535
public function syncing_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'node/syncing', function ($connection) {
37+
$this->assertResponse('GET', 'node/syncing', function ($connection) {
3838
return $connection->node()->syncing();
3939
});
4040
}
4141

4242
/** @test */
4343
public function configuration_calls_correct_url()
4444
{
45-
$this->assertResponse(2, 'GET', 'node/configuration', function ($connection) {
45+
$this->assertResponse('GET', 'node/configuration', function ($connection) {
4646
return $connection->node()->configuration();
4747
});
4848
}
4949

5050
/** @test */
5151
public function fees_calls_correct_url()
5252
{
53-
$this->assertResponse(2, 'GET', 'node/fees', function ($connection) {
53+
$this->assertResponse('GET', 'node/fees', function ($connection) {
5454
return $connection->node()->fees();
5555
});
5656
}

tests/API/PeersTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class PeersTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'peers', function ($connection) {
29+
$this->assertResponse('GET', 'peers', function ($connection) {
3030
return $connection->peers()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function show_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'peers/dummy', function ($connection) {
37+
$this->assertResponse('GET', 'peers/dummy', function ($connection) {
3838
return $connection->peers()->show('dummy');
3939
});
4040
}

tests/API/TransactionsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,55 +26,55 @@ class TransactionsTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'transactions', function ($connection) {
29+
$this->assertResponse('GET', 'transactions', function ($connection) {
3030
return $connection->transactions()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function create_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'POST', 'transactions', function ($connection) {
37+
$this->assertResponse('POST', 'transactions', function ($connection) {
3838
return $connection->transactions()->create(['transactions' => []]);
3939
});
4040
}
4141

4242
/** @test */
4343
public function show_calls_correct_url()
4444
{
45-
$this->assertResponse(2, 'GET', 'transactions/dummy', function ($connection) {
45+
$this->assertResponse('GET', 'transactions/dummy', function ($connection) {
4646
return $connection->transactions()->show('dummy');
4747
});
4848
}
4949

5050
/** @test */
5151
public function all_unconfirmed_calls_correct_url()
5252
{
53-
$this->assertResponse(2, 'GET', 'transactions/unconfirmed', function ($connection) {
53+
$this->assertResponse('GET', 'transactions/unconfirmed', function ($connection) {
5454
return $connection->transactions()->allUnconfirmed();
5555
});
5656
}
5757

5858
/** @test */
5959
public function show_unconfirmed_calls_correct_url()
6060
{
61-
$this->assertResponse(2, 'GET', 'transactions/unconfirmed/dummy', function ($connection) {
61+
$this->assertResponse('GET', 'transactions/unconfirmed/dummy', function ($connection) {
6262
return $connection->transactions()->showUnconfirmed('dummy');
6363
});
6464
}
6565

6666
/** @test */
6767
public function search_calls_correct_url()
6868
{
69-
$this->assertResponse(2, 'POST', 'transactions/search', function ($connection) {
69+
$this->assertResponse('POST', 'transactions/search', function ($connection) {
7070
return $connection->transactions()->search(['amount' => 1]);
7171
});
7272
}
7373

7474
/** @test */
7575
public function types_calls_correct_url()
7676
{
77-
$this->assertResponse(2, 'GET', 'transactions/types', function ($connection) {
77+
$this->assertResponse('GET', 'transactions/types', function ($connection) {
7878
return $connection->transactions()->types();
7979
});
8080
}

tests/API/VotesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ class VotesTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'votes', function ($connection) {
29+
$this->assertResponse('GET', 'votes', function ($connection) {
3030
return $connection->votes()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function show_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'votes/dummy', function ($connection) {
37+
$this->assertResponse('GET', 'votes/dummy', function ($connection) {
3838
return $connection->votes()->show('dummy');
3939
});
4040
}

tests/API/WalletsTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,63 +26,63 @@ class WalletsTest extends TestCase
2626
/** @test */
2727
public function all_calls_correct_url()
2828
{
29-
$this->assertResponse(2, 'GET', 'wallets', function ($connection) {
29+
$this->assertResponse('GET', 'wallets', function ($connection) {
3030
return $connection->wallets()->all();
3131
});
3232
}
3333

3434
/** @test */
3535
public function top_calls_correct_url()
3636
{
37-
$this->assertResponse(2, 'GET', 'wallets/top', function ($connection) {
37+
$this->assertResponse('GET', 'wallets/top', function ($connection) {
3838
return $connection->wallets()->top();
3939
});
4040
}
4141

4242
/** @test */
4343
public function show_calls_correct_url()
4444
{
45-
$this->assertResponse(2, 'GET', 'wallets/dummy', function ($connection) {
45+
$this->assertResponse('GET', 'wallets/dummy', function ($connection) {
4646
return $connection->wallets()->show('dummy');
4747
});
4848
}
4949

5050
/** @test */
5151
public function transactions_calls_correct_url()
5252
{
53-
$this->assertResponse(2, 'GET', 'wallets/dummy/transactions', function ($connection) {
53+
$this->assertResponse('GET', 'wallets/dummy/transactions', function ($connection) {
5454
return $connection->wallets()->transactions('dummy');
5555
});
5656
}
5757

5858
/** @test */
5959
public function sent_transactions_calls_correct_url()
6060
{
61-
$this->assertResponse(2, 'GET', 'wallets/dummy/transactions/sent', function ($connection) {
61+
$this->assertResponse('GET', 'wallets/dummy/transactions/sent', function ($connection) {
6262
return $connection->wallets()->sentTransactions('dummy');
6363
});
6464
}
6565

6666
/** @test */
6767
public function received_transactions_calls_correct_url()
6868
{
69-
$this->assertResponse(2, 'GET', 'wallets/dummy/transactions/received', function ($connection) {
69+
$this->assertResponse('GET', 'wallets/dummy/transactions/received', function ($connection) {
7070
return $connection->wallets()->receivedTransactions('dummy');
7171
});
7272
}
7373

7474
/** @test */
7575
public function votes_calls_correct_url()
7676
{
77-
$this->assertResponse(2, 'GET', 'wallets/dummy/votes', function ($connection) {
77+
$this->assertResponse('GET', 'wallets/dummy/votes', function ($connection) {
7878
return $connection->wallets()->votes('dummy');
7979
});
8080
}
8181

8282
/** @test */
8383
public function search_calls_correct_url()
8484
{
85-
$this->assertResponse(2, 'POST', 'wallets/search', function ($connection) {
85+
$this->assertResponse('POST', 'wallets/search', function ($connection) {
8686
return $connection->wallets()->search(['address' => 'dummy']);
8787
});
8888
}

tests/ConnectionManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,6 @@ public function it_should_return_all_connections()
107107

108108
private function setUpConfig(): array
109109
{
110-
return ['host' => $this->host, 'version' => 1];
110+
return ['host' => $this->host];
111111
}
112112
}

tests/ConnectionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ private function getConnection(): Connection
7272
{
7373
return (new ConnectionManager())->connect([
7474
'host' => $this->host,
75-
'version' => 2,
7675
]);
7776
}
7877
}

tests/TestCase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ abstract class TestCase extends BaseTestCase
3232
/**
3333
* Perform a mocked request and assert its response.
3434
*
35-
* @param int $version
3635
* @param string $method
3736
* @param string $path
3837
* @param callable $callback
3938
* @param array|null $expectedBody
4039
*/
41-
protected function assertResponse(int $version, string $method, string $path, callable $callback, array $expectedBody = []): void
40+
protected function assertResponse(string $method, string $path, callable $callback, array $expectedBody = []): void
4241
{
4342
$mockHandler = new MockHandler([new Response(200, [], json_encode($expectedBody))]);
4443

0 commit comments

Comments
 (0)