Skip to content

Commit def475f

Browse files
committed
Add should_delete_plan test to PlanTest
1 parent 60e0b2e commit def475f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/Api/Plans/Plan.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ public function update(string $id, array $data)
7676
*
7777
* @return array|string
7878
*/
79-
public function delete(string $id, array $data)
79+
public function delete(string $id)
8080
{
8181
$url = $this->url('plans/%s/delete', $id);
8282

83-
return $this->post($url, $data);
83+
return $this->post($url, []);
8484
}
8585

8686
/**

tests/Unit/Api/Plans/PlanTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ public function should_unarchive_plan()
9191
$this->assertEquals($expected, $plan->unarchive('basic_v2'));
9292
}
9393

94+
/** @test */
95+
public function should_delete_plan()
96+
{
97+
$expected = $this->getContent(sprintf('%s/data/responses/plan_deleted.json', __DIR__));
98+
99+
$plan = $this->getApiMock();
100+
$plan->expects($this->once())
101+
->method('post')
102+
->with('https://123456789.chargebee.com/api/v2/plans/silver/delete', [])
103+
->will($this->returnValue($expected));
104+
105+
$this->assertEquals($expected, $plan->delete('silver'));
106+
}
107+
94108
/**
95109
* @return string
96110
*/

0 commit comments

Comments
 (0)