$handler]); $note = Note::find(1); $source = 'https://example.org/mention/1/'; $job = new ProcessWebMention($note, $source); $job->handle($parser, $client); } public function test_a_new_webmention_gets_saved() { Queue::fake(); $parser = new Parser(); $html = << I liked a note. HTML; $html = str_replace('href="', 'href="' . config('app.url'), $html); $mock = new MockHandler([ new Response(200, [], $html), ]); $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $note = Note::find(1); $source = 'https://example.org/mention/1/'; $job = new ProcessWebMention($note, $source); $job->handle($parser, $client); Queue::assertPushed(SaveProfileImage::class); $this->assertDatabaseHas('webmentions', [ 'source' => $source, 'type' => 'like-of', ]); } public function test_existing_webmention_gets_updated() { Queue::fake(); $parser = new Parser(); $html = <<
In reply to