Skip to content

Instantly share code, notes, and snippets.

@afestein
Created March 18, 2014 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afestein/9613720 to your computer and use it in GitHub Desktop.
Save afestein/9613720 to your computer and use it in GitHub Desktop.
<?php
use CVCNetwork\YesheisCatalog\Models\LandingPage;
/**
* Created by IntelliJ IDEA.
* User: adrianstein
* Date: 18/03/2014
* Time: 10:53 AM
*/
class LandingPageTest extends SeededTestCase {
public function setUp()
{
parent::setUp();
}
public function tearDown(){
\Mockery::close();
}
public function testNonExistentLandingPageReroutesToLanguageSpecificHome() {
$this->call('GET', '/zh-hans/landing/dudpage.com');
$this->assertResponseStatus(302);
$this->assertRedirectedTo('/zh-hans');
}
public function testDeletedLandingPageReroutesToLanguageSpecificHome() {
$this->call('GET', '/en/stopabuseonkids.net');
$this->assertResponseStatus(302);
$this->assertRedirectedTo('/en');
}
public function testLandingPageExistsInDatabase()
{
$thedata = LandingPage::where('domain', 'atesturl.com')->get()->toArray();
$this->assertNotNull($thedata);
$this->assertNotEmpty($thedata[0]['lpid']);
}
public function testLandingPageIsActive()
{
/* Draft = 0, Live = 1, On Hold = 2, Deleted = 3. */
$thedata = LandingPage::where('domain', 'iwanttoquitdrinking.com')->get()->toArray();
$this->assertNotNull($thedata[0]['status']);
$this->assertEquals(1,$thedata[0]['status']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment