From 0ca17f2d0a913a753b39e2e22c1a30ad23834eee Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Thu, 16 Feb 2017 15:42:44 +0000 Subject: [PATCH] Fix tests --- app/Http/Controllers/MicropubController.php | 2 +- tests/IndieAuthTest.php | 10 +++++----- tests/MicropubClientTest.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/MicropubController.php b/app/Http/Controllers/MicropubController.php index fa7c5a02..ddfebfc0 100644 --- a/app/Http/Controllers/MicropubController.php +++ b/app/Http/Controllers/MicropubController.php @@ -166,7 +166,7 @@ class MicropubController extends Controller return response()->json([ 'response' => 'error', 'error' => 'no_token', - 'error_description' + 'error_description' => 'No token provided with request' ], 400); } } diff --git a/tests/IndieAuthTest.php b/tests/IndieAuthTest.php index 40a88337..97fdadf7 100644 --- a/tests/IndieAuthTest.php +++ b/tests/IndieAuthTest.php @@ -52,24 +52,24 @@ class IndieAuthTest extends BrowserKitTest } /** - * Test the `beginauth` method redirects to the client on error. + * Test the `start` method redirects to the client on error. * * @return void */ public function testIndieAuthControllerBeginAuthRedirectsToClientOnFail() { - $response = $this->call('GET', $this->appurl . '/beginauth', ['me' => 'http://example.org']); - $this->assertSame($this->appurl . '/notes/new', $response->headers->get('Location')); + $response = $this->call('GET', $this->appurl . '/indieauth/start', ['me' => 'http://example.org']); + $this->assertSame($this->appurl . '/micropub/create', $response->headers->get('Location')); } /** - * Now we test the `beginauth` method as a whole. + * Now we test the `start` method as a whole. * * @return void */ public function testIndieAuthControllerBeginAuthRedirectsToEndpoint() { - $response = $this->call('GET', $this->appurl . '/beginauth', ['me' => $this->appurl]); + $response = $this->call('GET', $this->appurl . '/indieauth/start', ['me' => $this->appurl]); $this->assertSame( 'https://indieauth.com/auth?me=', substr($response->headers->get('Location'), 0, 30) diff --git a/tests/MicropubClientTest.php b/tests/MicropubClientTest.php index 3017e07b..67299155 100644 --- a/tests/MicropubClientTest.php +++ b/tests/MicropubClientTest.php @@ -26,13 +26,13 @@ class MicropubClientTest extends BrowserKitTest */ public function testClientPageUnauthorised() { - $this->visit($this->appurl . '/notes/new') + $this->visit($this->appurl . '/micropub/create') ->see('IndieAuth'); } public function testClientPageRecentAuth() { - $this->visit($this->appurl . '/notes/new') + $this->visit($this->appurl . '/micropub/create') ->see($this->appurl); } @@ -41,7 +41,7 @@ class MicropubClientTest extends BrowserKitTest //in this test, the syndication targets are blank $faker = \Faker\Factory::create(); $note = 'Fake note from #PHPUnit: ' . $faker->text; - $this->visit($this->appurl . '/notes/new') + $this->visit($this->appurl . '/micropub/create') ->type($note, 'content') ->press('Submit'); $this->seeInDatabase('notes', ['note' => $note]);