Skip to content

Instantly share code, notes, and snippets.

@fwartner
Created August 3, 2020 06:00
Show Gist options
  • Save fwartner/f8f281a45da6b518a90847d7529bb9c7 to your computer and use it in GitHub Desktop.
Save fwartner/f8f281a45da6b518a90847d7529bb9c7 to your computer and use it in GitHub Desktop.
HTTP Test
<?php
namespace Tests\Feature\Http\Controllers\Blog;
use App\Http\Controllers\Blog\PostController;
use Tests\TestCase;
/**
* Class PostControllerTest.
*
* @covers \App\Http\Controllers\Blog\PostController
*/
class PostControllerTest extends TestCase
{
/**
* @var PostController
*/
protected $postController;
/**
* {@inheritdoc}
*/
protected function setUp(): void
{
parent::setUp();
/** @todo Correctly instantiate tested object to use it. */
$this->postController = new PostController();
$this->app->instance(PostController::class, $this->postController);
}
/**
* {@inheritdoc}
*/
protected function tearDown(): void
{
parent::tearDown();
unset($this->postController);
}
public function testIndex(): void
{
/** @todo This test is incomplete. */
$this->get('/path')
->assertStatus(200);
}
public function testCreate(): void
{
/** @todo This test is incomplete. */
$this->get('/path')
->assertStatus(200);
}
public function testStore(): void
{
/** @todo This test is incomplete. */
$this->post('/path', [ /* data */ ])
->assertStatus(200);
}
public function testShow(): void
{
/** @todo This test is incomplete. */
$this->get('/path')
->assertStatus(200);
}
public function testEdit(): void
{
/** @todo This test is incomplete. */
$this->get('/path')
->assertStatus(200);
}
public function testUpdate(): void
{
/** @todo This test is incomplete. */
$this->put('/path', [ /* data */ ])
->assertStatus(200);
}
public function testDestroy(): void
{
/** @todo This test is incomplete. */
$this->delete('/path')
->assertStatus(200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment