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:
parent
7c559860dc
commit
151072cd1b
10 changed files with 1 additions and 314 deletions
|
@ -7,7 +7,6 @@ use Tests\TestToken;
|
|||
use App\Jobs\ProcessBookmark;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use App\Jobs\SyndicateBookmarkToTwitter;
|
||||
use App\Jobs\SyndicateBookmarkToFacebook;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class BookmarksTest extends TestCase
|
||||
|
@ -37,7 +36,6 @@ class BookmarksTest extends TestCase
|
|||
'bookmark-of' => 'https://example.org/blog-post',
|
||||
'mp-syndicate-to' => [
|
||||
'https://twitter.com/jonnybarnes',
|
||||
'https://facebook.com/jonnybarnes',
|
||||
],
|
||||
]);
|
||||
|
||||
|
@ -45,7 +43,6 @@ class BookmarksTest extends TestCase
|
|||
|
||||
Queue::assertPushed(ProcessBookmark::class);
|
||||
Queue::assertPushed(SyndicateBookmarkToTwitter::class);
|
||||
Queue::assertPushed(SyndicateBookmarkToFacebook::class);
|
||||
$this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']);
|
||||
}
|
||||
|
||||
|
@ -61,7 +58,6 @@ class BookmarksTest extends TestCase
|
|||
'bookmark-of' => ['https://example.org/blog-post'],
|
||||
'mp-syndicate-to' => [
|
||||
'https://twitter.com/jonnybarnes',
|
||||
'https://facebook.com/jonnybarnes',
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
@ -70,7 +66,6 @@ class BookmarksTest extends TestCase
|
|||
|
||||
Queue::assertPushed(ProcessBookmark::class);
|
||||
Queue::assertPushed(SyndicateBookmarkToTwitter::class);
|
||||
Queue::assertPushed(SyndicateBookmarkToFacebook::class);
|
||||
$this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']);
|
||||
}
|
||||
|
||||
|
@ -93,25 +88,6 @@ class BookmarksTest extends TestCase
|
|||
$this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']);
|
||||
}
|
||||
|
||||
public function test_single_facebook_syndication_target_causes_job_dispatch_http_post_syntax()
|
||||
{
|
||||
Queue::fake();
|
||||
|
||||
$response = $this->withHeaders([
|
||||
'Authorization' => 'Bearer ' . $this->getToken(),
|
||||
])->post('/api/post', [
|
||||
'h' => 'entry',
|
||||
'bookmark-of' => 'https://example.org/blog-post',
|
||||
'mp-syndicate-to' => 'https://facebook.com/jonnybarnes',
|
||||
]);
|
||||
|
||||
$response->assertJson(['response' => 'created']);
|
||||
|
||||
Queue::assertPushed(ProcessBookmark::class);
|
||||
Queue::assertPushed(SyndicateBookmarkToFacebook::class);
|
||||
$this->assertDatabaseHas('bookmarks', ['url' => 'https://example.org/blog-post']);
|
||||
}
|
||||
|
||||
public function test_tags_created_with_new_bookmark()
|
||||
{
|
||||
Queue::fake();
|
||||
|
|
|
@ -13,12 +13,4 @@ class BridgyPosseTest extends TestCase
|
|||
$html = $response->content();
|
||||
$this->assertTrue(is_string(mb_stristr($html, 'p-bridgy-twitter-content')));
|
||||
}
|
||||
|
||||
public function test_bridgy_facebook_content()
|
||||
{
|
||||
$response = $this->get('/notes/E');
|
||||
|
||||
$html = $response->content();
|
||||
$this->assertTrue(is_string(mb_stristr($html, 'p-bridgy-facebook-content')));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ use App\Models\{Media, Place};
|
|||
use Illuminate\Http\UploadedFile;
|
||||
use App\Jobs\SyndicateNoteToTwitter;
|
||||
use Lcobucci\JWT\Signer\Hmac\Sha256;
|
||||
use App\Jobs\SyndicateNoteToFacebook;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Phaza\LaravelPostgis\Geometries\Point;
|
||||
|
@ -169,33 +168,6 @@ class MicropubControllerTest extends TestCase
|
|||
Queue::assertPushed(SyndicateNoteToTwitter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a valid micropub requests creates a new note and syndicates to Facebook.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function test_micropub_post_request_creates_new_note_sends_to_facebook()
|
||||
{
|
||||
Queue::fake();
|
||||
$faker = \Faker\Factory::create();
|
||||
$note = $faker->text;
|
||||
$response = $this->call(
|
||||
'POST',
|
||||
'/api/post',
|
||||
[
|
||||
'h' => 'entry',
|
||||
'content' => $note,
|
||||
'mp-syndicate-to' => 'https://facebook.com/jonnybarnes'
|
||||
],
|
||||
[],
|
||||
[],
|
||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||
);
|
||||
$response->assertJson(['response' => 'created']);
|
||||
$this->assertDatabaseHas('notes', ['note' => $note]);
|
||||
Queue::assertPushed(SyndicateNoteToFacebook::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a valid micropub requests creates a new place.
|
||||
*
|
||||
|
@ -320,7 +292,6 @@ class MicropubControllerTest extends TestCase
|
|||
'in-reply-to' => ['https://aaronpk.localhost'],
|
||||
'mp-syndicate-to' => [
|
||||
'https://twitter.com/jonnybarnes',
|
||||
'https://facebook.com/jonnybarnes',
|
||||
],
|
||||
'photo' => [config('filesystems.disks.s3.url') . '/test-photo.jpg'],
|
||||
],
|
||||
|
@ -332,7 +303,6 @@ class MicropubControllerTest extends TestCase
|
|||
->assertJson(['response' => 'created']);
|
||||
Queue::assertPushed(SendWebMentions::class);
|
||||
Queue::assertPushed(SyndicateNoteToTwitter::class);
|
||||
Queue::assertPushed(SyndicateNoteToFacebook::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue