Skip to content

Commit e5c4146

Browse files
committed
fix. and make tests
1 parent 1e23e6c commit e5c4146

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/wargaming.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,11 @@ public function serverInfo($region = null)
119119

120120
/**
121121
* @param string $search
122-
* @param array|null $option
122+
* @param array|null $options
123123
* @return array
124124
* @throws Exception
125125
*/
126-
public function searchClans($search, $option = null)
126+
public function searchClans($search, $options = null)
127127
{
128128

129129
if (strlen($search) == 0) {

tests/testWargamingApi.php

+18
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,22 @@ public function check_search_clans_with_default_option()
104104
$this->assertEquals(100, $clans['count']);
105105
}
106106

107+
/**
108+
* @test
109+
* @throws Exception
110+
*/
111+
public function check_search_clans_with_custom_option()
112+
{
113+
//Init Wargaming.net api key and region
114+
$war = new WargamingApi("e9807cace93606169c54fb8e9ec763b2", "eu");
115+
116+
$clans = $war->searchClans("aze", [
117+
"limit" => 10,
118+
"pagination" => 1,
119+
"region" => "ru"
120+
]);
121+
122+
$this->assertEquals(10, $clans['count']);
123+
}
124+
107125
}

0 commit comments

Comments
 (0)