Fix tests
This commit is contained in:
parent
b8c0724036
commit
0ca17f2d0a
3 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Add table
Reference in a new issue