public function testFacebookPost() { $params = ['message' => 'Message in a bottle', 'link' => 'http://google.com', 'picture' => 'http://placehold.it/200/400', 'name' => 'The one who must not be named', 'caption' => 'What an caption', 'description' => 'Description', 'place' => '', 'tags' => ['bottle'], 'targeting' => ['locales' => 5]]; $post = Socialmedia::post($params, ['facebook']); // Create a client with a base URI $client = new GuzzleHttp\Client(['base_uri' => 'https://graph.facebook.com/v2.6/']); $res = json_decode($client->request('GET', $post['facebook']->id . "?access_token=" . env('FACEBOOK_ACCESS_TOKEN'))->getBody()); $this->assertEquals('Message in a #bottle', $res->message); Socialmedia::delete($res->id, ["facebook"]); }
public function testPinterestPost() { $params = ['message' => 'Test Pin', 'link' => 'http://google.com', 'picture' => 'http://placehold.it/300/400', 'board' => 'marivnosswald/reiseziele']; $post = Socialmedia::post($params, ['pinterest']); Socialmedia::delete($post['pinterest']->id, ['pinterest']); }
public function testTwitterPost() { $message = 'Test Message'; $post = Socialmedia::post(['message' => $message], ['twitter']); Socialmedia::delete($post['twitter'], ['twitter']); }