Fixed testcases to account for show image path in and show instance description

This commit is contained in:
Duncan Sommerville 2014-10-09 09:39:50 -04:00
parent 6ade74163d
commit 0196aa21f5
28 changed files with 125 additions and 76 deletions

3
.gitignore vendored
View File

@ -6,3 +6,6 @@
**/build/*
**/dist/*
*~
/airtime_mvc/tests/test_results.xml
/tests/results.html
/tests/*.jar

View File

@ -145,8 +145,6 @@ class Application_Service_ShowService
->setDbDescription($showData['add_show_instance_description'])
->save();
//delete the edited instance from the repeating sequence
$ccShowInstanceOrig
->setDbModifiedInstance(true)

View File

@ -85,6 +85,21 @@ class TestHelper
$sql = "DELETE FROM cc_music_dirs";
AirtimeInstall::InstallQuery($sql, false);
// Because files are stored relative to their watch directory,
// we need to set the "stor" path before we can successfully
// create a fake file in the database.
//Copy paste from airtime-db-install.php:
$stor_dir = "/tmp";
$con = Propel::getConnection();
$sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('$stor_dir', 'stor')";
try {
$con->exec($sql);
} catch (Exception $e) {
echo " * Failed inserting {$stor_dir} in cc_music_dirs".PHP_EOL;
echo " * Message {$e->getMessage()}".PHP_EOL;
return false;
}
$con->commit();
//Because we're DELETEing all the rows instead of using TRUNCATE (for speed),

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -48,20 +48,7 @@ class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Fr
//$showService->setCcShow($testShowData); //Denise says this is not needed.
$showService->addUpdateShow($testShowData); //Create show instances
// Because files are stored relative to their watch directory,
// we need to set the "stor" path before we can successfully
// create a fake file in the database.
//Copy paste from airtime-db-install.php:
$stor_dir = "/tmp";
$con = Propel::getConnection();
$sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('$stor_dir', 'stor')";
try {
$con->exec($sql);
} catch (Exception $e) {
echo " * Failed inserting {$stor_dir} in cc_music_dirs".PHP_EOL;
echo " * Message {$e->getMessage()}".PHP_EOL;
return false;
}
// Moved creation of stor directory to TestHelper for setup
// Insert a fake file into the database
$request = $this->getRequest();

View File

@ -285,6 +285,7 @@ class ShowServiceDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances order by id');

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>
</dataset>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value>1</value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value>1</value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value>1</value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value></value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -14,6 +14,7 @@
<column>live_stream_pass</column>
<column>linked</column>
<column>is_linkable</column>
<column>image_path</column>
<row>
<value>1</value>
<value>test show</value>
@ -28,6 +29,7 @@
<null />
<value></value>
<value>1</value>
<value></value>
</row>
</table>

View File

@ -243,6 +243,7 @@ Class ShowServiceData
"add_show_id" => 1,
"add_show_instance_id" => 2,
"add_show_name" => "test show",
"add_show_instance_description" => "",
"add_show_url" => null,
"add_show_genre" => null,
"add_show_description" => null,