CC-5651: Unit Test the Scheduler
Created file that returns test data Added a non-repeating, non-record&rebroadcast show creation test (not working yet) Updated the cc_show_seed.xml file to include all 5 show tables
This commit is contained in:
parent
fea3f4073a
commit
94912ed445
3 changed files with 72 additions and 1 deletions
|
@ -3,6 +3,7 @@ require_once "Zend/Test/PHPUnit/DatabaseTestCase.php";
|
|||
require_once "ShowService.php";
|
||||
require_once "../application/configs/conf.php";
|
||||
require_once "AirtimeInstall.php";
|
||||
require_once "ShowData.php";
|
||||
|
||||
class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
||||
{
|
||||
|
@ -103,4 +104,29 @@ class ShowTest extends Zend_Test_PHPUnit_DatabaseTestCase
|
|||
$ds
|
||||
);
|
||||
}
|
||||
|
||||
/* Tests that a non-repeating, non-record, and non-rebroadcast show
|
||||
* gets created properly
|
||||
*/
|
||||
public function testNoRepeatNoRRShowCreated()
|
||||
{
|
||||
$data = ShowData::getNoRepeatNoRRData();
|
||||
$showService = new Application_Service_ShowService();
|
||||
|
||||
$showService->addUpdateShow($data);
|
||||
|
||||
$ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet(
|
||||
$this->getConnection()
|
||||
);
|
||||
$ds->addTable('cc_show', 'select * from cc_show');
|
||||
$ds->addTable('cc_show_days', 'select * from cc_show_days');
|
||||
$ds->addTable('cc_show_instances', 'select * from cc_show_instances');
|
||||
$ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast');
|
||||
$ds->addTable('cc_show_hosts', 'select * from cc_show_hosts');
|
||||
|
||||
$this->assertDataSetsEqual(
|
||||
$this->createXmlDataSet(dirname(__FILE__)."/files/cc_show_insertIntoAssertion.xml"),
|
||||
$ds
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue