diff --git a/phpunit.xml b/phpunit.xml index f37265d..993b099 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -2,7 +2,7 @@ tests/ - + tests/IntegrationTest.php diff --git a/src/WeiboAd/Core/AccountApi.php b/src/WeiboAd/Core/AccountApi.php index faa7650..c6df710 100644 --- a/src/WeiboAd/Core/AccountApi.php +++ b/src/WeiboAd/Core/AccountApi.php @@ -15,7 +15,6 @@ class AccountApi extends AbstractApi const URI_READING = "/account"; const URI_BUDGET = "/account/budget"; const URI_ASSET = "/account/asset"; - const URI_BUDGET = "/account/budget"; /*获取广告账户信息 * return Account; @@ -44,16 +43,7 @@ public function asset() return $this->api->getApiRequest()->call(self::URI_ASSET, 'GET'); } - /** - * @param $budget - * @return Account - */ - public function budget($budget) - { - $putData = ['spend_cap' => $budget]; - $data = $this->api->getApiRequest()->call(self::URI_BUDGET, 'PUT', $putData); - return new Account($data); - } + } diff --git a/tests/Core/AccountApiTest.php b/tests/Core/AccountApiTest.php index 78764ce..b930975 100644 --- a/tests/Core/AccountApiTest.php +++ b/tests/Core/AccountApiTest.php @@ -44,16 +44,6 @@ public function testAsset() $this->assertEquals("9.19", $r['real_time_consume']); } - public function testBudget() - { - $api = $this->getMockApi(); - $apiRequest = $this->getMockApiRequest(); - $apiRequest->method('call')->with('/account/budget', 'PUT')->willReturn(['id' => 1]); - $api->method("getApiRequest")->willReturn($apiRequest); - $accountApi = new AccountApi($api); - $r = $accountApi->budget(100); - $this->assertEquals(1, $r->getId()); - } } \ No newline at end of file