Last active
May 8, 2017 14:18
-
-
Save StyxOfDynamite/7d0a84b8faf177c8282ae16e719217bb to your computer and use it in GitHub Desktop.
Testing Profanity Filter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ProfanityTest extends TestCase { | |
protected $filter; | |
public function setUp() | |
{ | |
$this->filter = new ProfanityFilter(); | |
} | |
public function testTrue() | |
{ | |
$this->assertTrue(true); | |
} | |
public function testIsNaughty() | |
{ | |
$review = new Review(); | |
$review->title = 'fuck this was rubbish.'; | |
$this->assertTrue($this->filter->isNaughty($review)); | |
} | |
public function testIsNice() | |
{ | |
$rev = new Review(); | |
$rev->title = 'Flip. this was nice.'; | |
$this->assertFalse($this->filter->isNaughty($review)); | |
} | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ProfanityTest extends TestCase { | |
public function testTrue() | |
{ | |
$this->assertTrue(true); | |
} | |
public function testIsNaughty() | |
{ | |
$pf = new ProfanityFilter(); | |
$review = new Review(); | |
$review->title = 'fuck this was rubbish.'; | |
$this->assertTrue($pf->isNaughty($review)); | |
} | |
public function testIsNice() | |
{ | |
$pf = new ProfanityFilter(); | |
$rev = new Review(); | |
$rev->title = 'Flip. this was nice.'; | |
$this->assertFalse($pf->isNaughty($review)); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment