From 6eaa643d3512dd29bca3f9127dc08e544adc04a9 Mon Sep 17 00:00:00 2001 From: Webber Wu Date: Fri, 22 Jul 2016 09:45:29 +0800 Subject: [PATCH] FriendshipsTest->testCreate() refactoring --- tests/PIXNET/Pix/Friend/FriendshipsTest.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/PIXNET/Pix/Friend/FriendshipsTest.php b/tests/PIXNET/Pix/Friend/FriendshipsTest.php index 7930baf..1e9c25c 100644 --- a/tests/PIXNET/Pix/Friend/FriendshipsTest.php +++ b/tests/PIXNET/Pix/Friend/FriendshipsTest.php @@ -88,14 +88,11 @@ public function testSearch() public function testCreate() { - $actual_all = self::$pixapi->friend->friendships->create('emmatest4')['data']; - self::$pixapi->friend->friendships->delete('emmatest4')['data']; - - $actual = $actual_all['user_name']; - - $expected = 'emmatest4'; + $friendship = self::$pixapi->friend->friendships->create('emmatest4')['data']; + self::$pixapi->friend->friendships->delete('emmatest4'); + self::$pixapi->friend->subscriptions->delete('emmatest4'); - $this->assertEquals($expected, $actual); + $this->assertEquals('emmatest4', $friendship['user_name']); } /**