Squashed commit of the following:

commit 63912e4c20fc9b3d49670a0f547137d59aaa2ef4
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Fri Oct 12 19:18:21 2018 +0100

    Remove facebook syndication code
This commit is contained in:
Jonny Barnes 2018-10-12 19:38:08 +01:00
parent 7c559860dc
commit 151072cd1b
10 changed files with 1 additions and 314 deletions

View file

@ -1,38 +0,0 @@
<?php
namespace Tests\Unit\Jobs;
use Tests\TestCase;
use GuzzleHttp\Client;
use App\Models\Bookmark;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Handler\MockHandler;
use App\Jobs\SyndicateBookmarkToFacebook;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class SyndicateBookmarkToFacebookJobTest extends TestCase
{
use DatabaseTransactions;
public function test_the_job()
{
$json = json_encode([
'url' => 'https://facebook.com/123'
]);
$mock = new MockHandler([
new Response(201, ['Content-Type' => 'application/json'], $json),
]);
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$bookmark = Bookmark::find(1);
$job = new SyndicateBookmarkToFacebook($bookmark);
$job->handle($client);
$this->assertDatabaseHas('bookmarks', [
'id' => 1,
'syndicates' => '{"facebook": "https://facebook.com/123"}',
]);
}
}

View file

@ -1,38 +0,0 @@
<?php
namespace Tests\Unit\Jobs;
use Tests\TestCase;
use App\Models\Note;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Handler\MockHandler;
use App\Jobs\SyndicateNoteToFacebook;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class SyndicateNoteToFacebookJobTest extends TestCase
{
use DatabaseTransactions;
public function test_the_job()
{
$json = json_encode([
'url' => 'https://facebook.com/123'
]);
$mock = new MockHandler([
new Response(201, ['Content-Type' => 'application/json'], $json),
]);
$handler = HandlerStack::create($mock);
$client = new Client(['handler' => $handler]);
$note = Note::find(1);
$job = new SyndicateNoteToFacebook($note);
$job->handle($client);
$this->assertDatabaseHas('notes', [
'id' => 1,
'facebook_url' => 'https://facebook.com/123',
]);
}
}