Created
July 23, 2012 08:59
-
-
Save snize/3162720 to your computer and use it in GitHub Desktop.
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
class GuestbookTest extends PHPUnit_Extensions_Database_TestCase | |
{ | |
public function testAddEntry() | |
{ | |
$guestbook = new Guestbook(); | |
$guestbook->addEntry("suzy", "Hello world!"); | |
$queryTable = $this->getConnection()->createQueryTable( | |
'guestbook', 'SELECT * FROM guestbook' | |
); | |
$expectedTable = $this->createFlatXmlDataSet("expectedBook.xml") | |
->getTable("guestbook"); | |
$this->assertTablesEqual($expectedTable, $queryTable); | |
} | |
} |
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
class GuestbookTest extends PHPUnit_Extensions_Database_TestCase | |
{ | |
public function testAddEntry() | |
{ | |
$guestbook = new Guestbook(); | |
$guestbook->addEntry("suzy", "Hello world!"); | |
$queryTable = $this->getConnection()->createQueryTable( | |
'guestbook', 'SELECT * FROM guestbook' | |
); | |
$expectedTableObj = new PHPUnit_Extensions_Database_DataSet_YamlDataSet('_files/guestbook.yaml'); | |
$expectedTable = $expectedTableObj->getTable('guestbook'); | |
$this->assertTablesEqual($expectedTable, $queryTable); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment