Initial commit to new repo
This commit is contained in:
parent
a267f9bfcc
commit
a5173c981b
292 changed files with 17472 additions and 0 deletions
78
tests/ArticlesTest.php
Normal file
78
tests/ArticlesTest.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace App\Tests;
|
||||
|
||||
use TestCase;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ArticlesTest extends TestCase
|
||||
{
|
||||
protected $appurl;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->appurl = config('app.url');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the `/blog` page returns the article, this
|
||||
* means the database is being hit.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testArticlesPage()
|
||||
{
|
||||
$this->visit($this->appurl . '/blog')
|
||||
->see('My New Blog');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the `/blog/{year}` page returns the article, this
|
||||
* means the database is being hit.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testArticlesYearPage()
|
||||
{
|
||||
$this->visit($this->appurl . '/blog/2016')
|
||||
->see('My New Blog');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the `/blog/{year}/{month}` page returns the article,
|
||||
* this means the database is being hit.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testArticlesMonthPage()
|
||||
{
|
||||
$this->visit($this->appurl . '/blog/2016/01')
|
||||
->see('My New Blog');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test a single article page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testSingleArticlePage()
|
||||
{
|
||||
$this->visit($this->appurl . '/blog/2016/01/my-new-blog')
|
||||
->see('My New Blog');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the RSS feed.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testRSSFeed()
|
||||
{
|
||||
$response = $this->call('GET', $this->appurl . '/feed');
|
||||
|
||||
$this->assertEquals('application/rss+xml', $response->headers->get('Content-Type'));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue