Wrote some minor tests for functional testing
This commit is contained in:
parent
877919e810
commit
99bc1505e0
|
|
@ -1,21 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
class LoginTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testHomePage()
|
||||
{
|
||||
config(['app.url' => 'http://127.0.0.1:8000']);
|
||||
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testCustomerLoginPage()
|
||||
{
|
||||
config(['app.url' => 'http://127.0.0.1:8000']);
|
||||
|
||||
$response = $this->get('/customer/login');
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testCategoriesPage()
|
||||
{
|
||||
$categoryUrlSlug = 'marvel-figurines';
|
||||
|
||||
config(['app.url' => 'http://127.0.0.1:8000']);
|
||||
|
||||
$response = $this->get("/categories/{$categoryUrlSlug}");
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testCustomerRegistrationPage()
|
||||
{
|
||||
config(['app.url' => 'http://127.0.0.1:8000']);
|
||||
|
||||
$response = $this->get("/customer/register");
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
|
||||
public function testCartPage()
|
||||
{
|
||||
config(['app.url' => 'http://127.0.0.1:8000']);
|
||||
|
||||
$response = $this->get("/checkout/cart");
|
||||
|
||||
$response->assertStatus(200);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue