Skip to content

Commit

Permalink
修改合并冲突
Browse files Browse the repository at this point in the history
  • Loading branch information
xingzi committed Dec 25, 2018
1 parent ee96ebe commit 866662e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<testsuites>
<testsuite name="Weibo AdApi">
<directory>tests/</directory>
<!--<exclude>tests/IntegrationTest.php</exclude>-->
<exclude>tests/IntegrationTest.php</exclude>
</testsuite>
</testsuites>
<filter>
Expand Down
12 changes: 1 addition & 11 deletions src/WeiboAd/Core/AccountApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}



}
10 changes: 0 additions & 10 deletions tests/Core/AccountApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}


}

0 comments on commit 866662e

Please sign in to comment.