From bae3db83d81afa8d395286b607404402afa0e386 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Wed, 18 Nov 2020 21:01:07 +0200 Subject: [PATCH 01/16] empty commit to trigger travis --- temp | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 temp diff --git a/temp b/temp new file mode 100644 index 000000000..e69de29bb From 043c509e160f990f4f2ae8bb7e1650305c78f773 Mon Sep 17 00:00:00 2001 From: Kyle Robbertze Date: Wed, 18 Nov 2020 21:01:28 +0200 Subject: [PATCH 02/16] empty commit to trigger travis --- temp | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 temp diff --git a/temp b/temp deleted file mode 100644 index e69de29bb..000000000 From b5c88c28090f30f51dd8f15488ca908c609237a0 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 18 Nov 2020 17:01:22 -0500 Subject: [PATCH 03/16] Removing PHP 7.1 @paddatrapper --- .travis.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f041608d7..14640ada8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,9 +36,6 @@ jobs: - language: php php: 7.2 stage: test - - language: php - php: 7.1 - stage: test - language: php php: 7.0 stage: test @@ -74,8 +71,6 @@ jobs: php: 7.3 - language: php php: 7.2 - - language: php - php: 7.1 # https://github.com/LibreTime/libretime/issues/1041 - language: python python: 3.5 From 83a3977a9efd4045f33ca8d05b84d95137db347c Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Wed, 18 Nov 2020 22:44:43 -0500 Subject: [PATCH 04/16] Switch to bionic, add deps. for PyGObject --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d0fe1ab6d..80493fbcb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: xenial +dist: bionic services: - postgresql @@ -23,6 +23,12 @@ addons: - liquidsoap-plugin-vorbis - python3-gst-1.0 - silan + - gcc + - gir1.2-gtk-3.0 + - python3-gi + - python3-gi-cairo + - python-cairo + - pkg-config jobs: include: From 8e5359202eb106eb23ef073bd66e1e88bddb78d5 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 19 Nov 2020 08:07:10 -0500 Subject: [PATCH 05/16] Adding Libretime PPA, removing Xenial, CentOS PHP tests --- .travis.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80493fbcb..7391b11f3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,10 @@ env: global: - ENVIRONMENT=testing - LIBRETIME_LOG_DIR=/tmp/log/libretime + +before_install: + - sudo add-apt-repository -y ppa:libretime/libretime + - sudo apt-get -q update addons: apt: @@ -38,12 +42,6 @@ jobs: - language: php php: 7.2 stage: test - - language: php - php: 7.0 - stage: test - - language: php - php: 5.6 - stage: test - language: python python: 3.8 stage: test From 377dfdbff929584ec52bcefb57ba102b5dd25fb7 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 19 Nov 2020 08:55:07 -0500 Subject: [PATCH 06/16] Reverting back to Xenial --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7391b11f3..f53d7b8d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -dist: bionic +dist: xenial services: - postgresql @@ -42,6 +42,12 @@ jobs: - language: php php: 7.2 stage: test + - language: php + php: 7.0 + stage: test + - language: php + php: 5.6 + stage: test - language: python python: 3.8 stage: test From 128c6b37fa7f2075aa42c5c70f77fff664568e70 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 19 Nov 2020 14:15:09 -0500 Subject: [PATCH 07/16] Removing Selenium tests --- airtime_mvc/tests/application/bootstrap.php | 83 --- .../application/helpers/AirtimeInstall.php | 356 --------- .../tests/application/helpers/TestHelper.php | 136 ---- .../models/database/BlockDbTest.php | 95 --- .../models/database/ScheduleDbTest.php | 138 ---- .../models/database/datasets/seed_files.yml | 177 ----- .../database/datasets/seed_schedule.yml | 11 - .../datasets/test_checkOverlappingShows.yml | 270 ------- .../models/unit/PreferenceUnitTest.php | 21 - .../models/unit/ScheduleUnitTest.php | 78 -- .../services/database/ShowServiceDbTest.php | 698 ------------------ .../database/datasets/seed_show_service.yml | 11 - .../test_ccShowInsertedIntoDatabase.yml | 19 - ...hangeRepeatDayUpdatesScheduleCorrectly.yml | 79 -- ...test_createBiWeeklyRepeatNoEndNoRRShow.yml | 63 -- .../datasets/test_createLinkedShow.yml | 90 --- ...reateMonthlyMonthlyRepeatNoEndNoRRShow.yml | 54 -- ...createMonthlyWeeklyRepeatNoEndNoRRShow.yml | 54 -- .../datasets/test_createNoRepeatNoRRShow.yml | 45 -- .../datasets/test_createNoRepeatRRShow.yml | 185 ----- ...st_createQuadWeeklyRepeatNoEndNoRRShow.yml | 54 -- ...est_createTriWeeklyRepeatNoEndNoRRShow.yml | 54 -- .../test_createWeeklyRepeatNoEndNoRRShow.yml | 90 --- .../test_createWeeklyRepeatRRShow.yml | 208 ------ .../datasets/test_deleteRepeatingShow.yml | 6 - .../datasets/test_deleteShowInstance.yml | 90 --- ...test_deleteShowInstanceAndAllFollowing.yml | 204 ----- ...est_editRepeatingShowChangeNoEndOption.yml | 54 -- .../test_editRepeatingShowInstance.yml | 111 --- ...tRepeatShowDayUpdatesScheduleCorrectly.yml | 79 -- ...CreationWhenUserMovesForwardInCalendar.yml | 90 --- .../datasets/test_unlinkLinkedShow.yml | 90 --- .../datasets/test_weeklyToBiWeekly.yml | 63 -- .../datasets/test_weeklyToNoRepeat.yml | 45 -- .../services/unit/ShowServiceUnitTest.php | 139 ---- .../application/testdata/BlockModelData.php | 51 -- .../application/testdata/ShowServiceData.php | 513 ------------- airtime_mvc/tests/conf/airtime.conf | 51 -- airtime_mvc/tests/conf/testing/airtime.conf | 35 - airtime_mvc/tests/log/.keep | 0 airtime_mvc/tests/phpunit.xml | 30 - airtime_mvc/tests/runtests.sh | 37 - tests/README | 13 - tests/run_selenium.sh | 47 -- .../selenium/Add Media Skeleton Present.html | 37 - tests/selenium/Airtime.html | 22 - .../selenium/Calendar Add Show Skeleton.html | 146 ---- .../Calendar Day Week Month Views.html | 71 -- tests/selenium/Calendar Skeleton Present.html | 66 -- tests/selenium/Library Skeleton Present.html | 37 - tests/selenium/Login and Logout.html | 56 -- tests/selenium/Login.html | 37 - tests/selenium/Preferences Skeletons.html | 82 -- tests/selenium/System Menu Contents.html | 52 -- 54 files changed, 5423 deletions(-) delete mode 100644 airtime_mvc/tests/application/bootstrap.php delete mode 100644 airtime_mvc/tests/application/helpers/AirtimeInstall.php delete mode 100644 airtime_mvc/tests/application/helpers/TestHelper.php delete mode 100644 airtime_mvc/tests/application/models/database/BlockDbTest.php delete mode 100644 airtime_mvc/tests/application/models/database/ScheduleDbTest.php delete mode 100644 airtime_mvc/tests/application/models/database/datasets/seed_files.yml delete mode 100644 airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml delete mode 100644 airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml delete mode 100644 airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php delete mode 100644 airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php delete mode 100644 airtime_mvc/tests/application/services/database/ShowServiceDbTest.php delete mode 100644 airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml delete mode 100644 airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml delete mode 100644 airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php delete mode 100644 airtime_mvc/tests/application/testdata/BlockModelData.php delete mode 100644 airtime_mvc/tests/application/testdata/ShowServiceData.php delete mode 100644 airtime_mvc/tests/conf/airtime.conf delete mode 100644 airtime_mvc/tests/conf/testing/airtime.conf delete mode 100644 airtime_mvc/tests/log/.keep delete mode 100644 airtime_mvc/tests/phpunit.xml delete mode 100755 airtime_mvc/tests/runtests.sh delete mode 100644 tests/README delete mode 100755 tests/run_selenium.sh delete mode 100644 tests/selenium/Add Media Skeleton Present.html delete mode 100644 tests/selenium/Airtime.html delete mode 100644 tests/selenium/Calendar Add Show Skeleton.html delete mode 100644 tests/selenium/Calendar Day Week Month Views.html delete mode 100644 tests/selenium/Calendar Skeleton Present.html delete mode 100644 tests/selenium/Library Skeleton Present.html delete mode 100644 tests/selenium/Login and Logout.html delete mode 100644 tests/selenium/Login.html delete mode 100644 tests/selenium/Preferences Skeletons.html delete mode 100644 tests/selenium/System Menu Contents.html diff --git a/airtime_mvc/tests/application/bootstrap.php b/airtime_mvc/tests/application/bootstrap.php deleted file mode 100644 index 857399f1e..000000000 --- a/airtime_mvc/tests/application/bootstrap.php +++ /dev/null @@ -1,83 +0,0 @@ -query($sql)->fetchColumn(0); - } catch (PDOException $e){ - // no pref table therefore Airtime is not installed. - //We only get here if airtime database exists, but the table doesn't - //This state sometimes happens if a previous Airtime uninstall couldn't remove - //the database because it was busy, so it just removed the tables instead. - return null; - } - //if version is empty string, then version is older than version 1.8.0 - if ($version == '') { - try { - // If this table exists, then it's version 1.7.0 - $sql = "SELECT * FROM cc_show_rebroadcast LIMIT 1"; - $result = $con->query($sql)->fetchColumn(0); - $version = "1.7.0"; - } catch (Exception $e) { - $version = null; - } - } - return $version; - } - public static function DbTableExists($p_name) - { - $con = Propel::getConnection(); - try { - $sql = "SELECT * FROM ".$p_name." LIMIT 1"; - $con->query($sql); - } catch (PDOException $e){ - return false; - } - return true; - } - public static function InstallQuery($sql, $verbose = true) - { - $con = Propel::getConnection(); - try { - $con->exec($sql); - if ($verbose) { - echo "done.\n"; - } - } catch (Exception $e) { - echo "Error!\n".$e->getMessage()."\n"; - echo " SQL statement was:\n"; - echo " ".$sql."\n\n"; - } - } - public static function DropSequence($p_sequenceName) - { - AirtimeInstall::InstallQuery("DROP SEQUENCE IF EXISTS $p_sequenceName", false); - } - - - /** - * Try to connect to the database. Return true on success, false on failure. - * @param boolean $p_exitOnError - * Exit the program on failure. - * @return boolean - */ - public static function DbConnect($p_exitOnError = true) - { - $CC_CONFIG = Config::getConfig(); - try { - $con = Propel::getConnection(); - } catch (Exception $e) { - echo $e->getMessage().PHP_EOL; - echo "Database connection problem.".PHP_EOL; - echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists". - " with corresponding permissions.".PHP_EOL; - if ($p_exitOnError) { - exit(1); - } - return false; - } - return true; - } - /* TODO: This function should be moved to the media-monitor - * install script. */ - public static function InstallStorageDirectory() - { - $CC_CONFIG = Config::getConfig(); - echo "* Storage directory setup".PHP_EOL; - $ini = parse_ini_file(__DIR__."/airtime-install.ini"); - $stor_dir = $ini["storage_dir"]; - $dirs = array($stor_dir, $stor_dir."/organize"); - foreach ($dirs as $dir){ - if (!file_exists($dir)) { - if (mkdir($dir, 02775, true)){ - $rp = realpath($dir); - echo "* Directory $rp created".PHP_EOL; - } else { - echo "* Failed creating {$dir}".PHP_EOL; - exit(1); - } - } - else if (is_writable($dir)) { - $rp = realpath($dir); - echo "* Skipping directory already exists: $rp".PHP_EOL; - } - else { - $rp = realpath($dir); - echo "* Error: Directory already exists, but is not writable: $rp".PHP_EOL; - exit(1); - } - echo "* Giving Apache permission to access $rp".PHP_EOL; - $success = chown($rp, $CC_CONFIG["webServerUser"]); - $success = chgrp($rp, $CC_CONFIG["webServerUser"]); - $success = chmod($rp, 0775); - } - } - public static function CreateDatabaseUser() - { - $CC_CONFIG = Config::getConfig(); - echo " * Creating Airtime database user".PHP_EOL; - $username = $CC_CONFIG['dsn']['username']; - $password = $CC_CONFIG['dsn']['password']; - $command = "echo \"CREATE USER $username ENCRYPTED PASSWORD '$password' LOGIN CREATEDB NOCREATEUSER;\" | su postgres -c psql 2>/dev/null"; - @exec($command, $output, $results); - if ($results == 0) { - echo " * Database user '{$CC_CONFIG['dsn']['username']}' created.".PHP_EOL; - } else { - if (count($output) > 0) { - echo " * Could not create user '{$CC_CONFIG['dsn']['username']}': ".PHP_EOL; - echo implode(PHP_EOL, $output); - } - else { - echo " * Database user '{$CC_CONFIG['dsn']['username']}' already exists.".PHP_EOL; - } - } - } - public static function CreateDatabase() - { - $CC_CONFIG = Config::getConfig(); - $database = $CC_CONFIG['dsn']['database']; - $username = $CC_CONFIG['dsn']['username']; - $password = $CC_CONFIG['dsn']['password']; - $hostspec = $CC_CONFIG['dsn']['hostspec']; - - echo " * Creating Airtime database: " . $database . PHP_EOL; - - $dbExists = false; - try { - $con = pg_connect('user='.$username.' password='.$password.' host='.$hostspec); - - pg_query($con, 'CREATE DATABASE '.$database.' WITH ENCODING \'UTF8\' TEMPLATE template0 OWNER '.$username.';'); - - } catch (Exception $e) { - // rethrow if not a "database already exists" error - if ($e->getCode() != 2 && strpos($e->getMessage(), 'already exists') !== false) throw $e; - echo " * Database already exists." . PHP_EOL; - $dbExists = true; - } - - if (!$dbExists) { - echo " * Database $database created.".PHP_EOL; - } - return $dbExists; - } - public static function InstallPostgresScriptingLanguage() - { - $con = Propel::getConnection(); - // Install postgres scripting language - $sql = 'SELECT COUNT(*) FROM pg_language WHERE lanname = \'plpgsql\''; - $langIsInstalled = $con->query($sql)->fetchColumn(0); - if ($langIsInstalled == '0') { - echo " * Installing Postgres scripting language".PHP_EOL; - $sql = "CREATE LANGUAGE 'plpgsql'"; - AirtimeInstall::InstallQuery($sql, false); - } else { - echo " * Postgres scripting language already installed".PHP_EOL; - } - } - public static function CreateDatabaseTables($p_dbuser, $p_dbpasswd, $p_dbname, $p_dbhost) - { - echo " * Creating database tables".PHP_EOL; - // Put Propel sql files in Database - //$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql 2>/dev/null"; - $dir = self::GetAirtimeSrcDir()."/build/sql/"; - $files = array("schema.sql", "sequences.sql", "views.sql", "triggers.sql", "defaultdata.sql"); - foreach ($files as $f){ - $command = "export PGPASSWORD=$p_dbpasswd && psql --username $p_dbuser --dbname $p_dbname --host $p_dbhost --file $dir$f 2>&1"; - @exec($command, $output, $results); - } - AirtimeInstall::$databaseTablesCreated = true; - } - public final static function UpdateDatabaseTables() { - UpgradeManager::doUpgrade(); - } - public static function SetAirtimeVersion($p_version) - { - $con = Propel::getConnection(); - $sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'"; - $con->exec($sql); - Application_Model_Preference::SetAirtimeVersion($p_version); - } - public static function SetUniqueId() - { - $uniqueId = md5(uniqid("", true)); - Application_Model_Preference::SetUniqueId($uniqueId); - } - public static function GetAirtimeVersion() - { - $config = Config::getConfig(); - return $config['airtime_version']; - } - public static function DeleteFilesRecursive($p_path) - { - $command = "rm -rf \"$p_path\""; - exec($command); - } - public static function InstallPhpCode() - { - $CC_CONFIG = Config::getConfig(); - echo "* Installing PHP code to ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL; - exec("mkdir -p ".AirtimeInstall::CONF_DIR_WWW); - exec("cp -R ".AirtimeInstall::GetAirtimeSrcDir()."/* ".AirtimeInstall::CONF_DIR_WWW); - } - public static function UninstallPhpCode() - { - echo "* Removing PHP code from ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL; - exec('rm -rf "'.AirtimeInstall::CONF_DIR_WWW.'"'); - } - public static function DirCheck() - { - echo "Legend: \"+\" means the dir/file exists, \"-\" means that it does not.".PHP_EOL; - $dirs = array(AirtimeInstall::CONF_DIR_BINARIES, - AirtimeInstall::CONF_DIR_WWW, - AirtimeIni::CONF_FILE_AIRTIME, - AirtimeIni::CONF_FILE_LIQUIDSOAP, - AirtimeIni::CONF_FILE_PYPO, - AirtimeIni::CONF_FILE_RECORDER, - "/usr/lib/airtime/pypo", - "/var/log/airtime", - "/var/log/airtime/pypo", - "/var/tmp/airtime/pypo"); - foreach ($dirs as $f) { - if (file_exists($f)) { - echo "+ $f".PHP_EOL; - } else { - echo "- $f".PHP_EOL; - } - } - } - public static function CreateZendPhpLogFile(){ - $CC_CONFIG = Config::getConfig(); - $path = AirtimeInstall::CONF_DIR_LOG; - $file = $path.'/zendphp.log'; - if (!file_exists($path)){ - mkdir($path, 0755, true); - } - touch($file); - chmod($file, 0644); - chown($file, $CC_CONFIG['webServerUser']); - chgrp($file, $CC_CONFIG['webServerUser']); - } - public static function RemoveLogDirectories(){ - $path = AirtimeInstall::CONF_DIR_LOG; - echo "* Removing logs directory ".$path.PHP_EOL; - exec("rm -rf \"$path\""); - } - public static function removeVirtualEnvDistributeFile(){ - echo "* Removing distribute-0.6.10.tar.gz".PHP_EOL; - if(file_exists('/usr/share/python-virtualenv/distribute-0.6.10.tar.gz')){ - exec("rm -f /usr/share/python-virtualenv/distribute-0.6.10.tar.gz"); - } - } - public static function printUsage($opts) - { - $msg = $opts->getUsageMessage(); - echo PHP_EOL."Usage: airtime-install [options]"; - echo substr($msg, strpos($msg, "\n")).PHP_EOL; - } - public static function getOpts() - { - try { - $autoloader = Zend_Loader_Autoloader::getInstance(); - $opts = new Zend_Console_Getopt( - array( - 'help|h' => 'Displays usage information.', - 'overwrite|o' => 'Overwrite any existing config files.', - 'preserve|p' => 'Keep any existing config files.', - 'no-db|n' => 'Turn off database install.', - 'reinstall|r' => 'Force a fresh install of this Airtime Version', - 'webonly|w' => 'Install only web files' - ) - ); - $opts->parse(); - } catch (Zend_Console_Getopt_Exception $e) { - print $e->getMessage() .PHP_EOL; - AirtimeInstall::printUsage($opts); - return NULL; - } - return $opts; - } - public static function checkPHPVersion() - { - if (PHP_VERSION_ID < 50300) - { - echo "Error: Airtime requires PHP 5.3 or greater."; - return false; - } - return true; - } -} diff --git a/airtime_mvc/tests/application/helpers/TestHelper.php b/airtime_mvc/tests/application/helpers/TestHelper.php deleted file mode 100644 index e2953328a..000000000 --- a/airtime_mvc/tests/application/helpers/TestHelper.php +++ /dev/null @@ -1,136 +0,0 @@ -setIdentity('admin') - ->setCredential('admin'); - - $auth = Zend_Auth::getInstance(); - $result = $auth->authenticate($authAdapter); - if ($result->isValid()) { - //all info about this user from the login table omit only the password - $userInfo = $authAdapter->getResultRowObject(null, 'password'); - - //the default storage is a session with namespace Zend_Auth - $authStorage = $auth->getStorage(); - $authStorage->write($userInfo); - } - } - - public static function getDbZendConfig() - { - $config = Config::getConfig(); - return new Zend_Config( - array( - 'host' => $config['dsn']['hostspec'], - 'dbname' => $config['dsn']['database'], - 'username' => $config['dsn']['username'], - 'password' => $config['dsn']['password'] - ) - ); - } - - public static function installTestDatabase() - { - //We need to load the config before our app bootstrap runs. The config - //is normally - $CC_CONFIG = Config::getConfig(); - - $dbuser = $CC_CONFIG['dsn']['username']; - $dbpasswd = $CC_CONFIG['dsn']['password']; - $dbname = $CC_CONFIG['dsn']['database']; - $dbhost = $CC_CONFIG['dsn']['hostspec']; - - $databaseAlreadyExists = AirtimeInstall::createDatabase(); - if ($databaseAlreadyExists) - { - //Truncate all the tables - $con = Propel::getConnection(); - $sql = "select * from pg_tables where tableowner = '${dbuser}'"; - try { - $rows = $con->query($sql)->fetchAll(); - } catch (Exception $e) { - $rows = array(); - } - - //Add any tables that shouldn't be cleared here. - // cc_subjs - Most of Airtime requires an admin account to work, which has id=1, - // so don't clear it. - // cc_music_dirs - Has foreign key constraints against cc_files, so we clear cc_files - // first and clear cc_music_dirs after - $tablesToNotClear = array("cc_subjs", "cc_music_dirs"); - - $con->beginTransaction(); - foreach ($rows as $row) { - $tablename = $row["tablename"]; - if (in_array($tablename, $tablesToNotClear)) - { - continue; - } - //echo " * Clearing database table $tablename..."; - - //TRUNCATE is actually slower than DELETE in many cases: - //http://stackoverflow.com/questions/11419536/postgresql-truncation-speed - //$sql = "TRUNCATE TABLE $tablename CASCADE"; - $sql = "DELETE FROM $tablename"; - AirtimeInstall::InstallQuery($sql, false); - } - - //Now that cc_files is empty, clearing cc_music_dirs should work - $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), - //we have to reset the sequences so the auto-increment columns (like primary keys) - //all start at 1 again. This is hacky but it still lets all of this execute fast. - $sql = "SELECT c.relname FROM pg_class c WHERE c.relkind = 'S'"; - try { - $rows = $con->query($sql)->fetchAll(); - } catch (Exception $e) { - $rows = array(); - } - $con->beginTransaction(); - foreach ($rows as $row) { - $seqrelname= $row["relname"]; - $sql = "ALTER SEQUENCE ${seqrelname} RESTART WITH 1"; - AirtimeInstall::InstallQuery($sql, false); - } - $con->commit(); - } - else - { - //Create all the database tables - AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost); - AirtimeInstall::UpdateDatabaseTables(); - } - } - - public static function setupZendBootstrap() - { - $application = new Zend_Application(APPLICATION_ENV, CONFIG_PATH . 'application.ini'); - $application->bootstrap(); - return $application; - } -} diff --git a/airtime_mvc/tests/application/models/database/BlockDbTest.php b/airtime_mvc/tests/application/models/database/BlockDbTest.php deleted file mode 100644 index 1df24c40d..000000000 --- a/airtime_mvc/tests/application/models/database/BlockDbTest.php +++ /dev/null @@ -1,95 +0,0 @@ -_connectionMock == null) { - $config = TestHelper::getDbZendConfig(); - - $connection = Zend_Db::factory('pdo_pgsql', $config); - - $this->_connectionMock = $this->createZendDbConnection( - $connection, - 'airtimeunittests' - ); - Zend_Db_Table_Abstract::setDefaultAdapter($connection); - } - return $this->_connectionMock; - } - - - /** - * Load a dataset into the database for the block database tests - * - * Defines how the initial state of the database should look before each test is executed - * Called once during setUp() and gets recreated for each new test - */ - public function getDataSet() - { - $dataset = new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/seed_files.yml' ); - return $dataset; - } - - - /** - * Test if the single newest file is added to the Database - * - */ - - public function testGetListofFilesMeetCriteriaSingleMatch() { - TestHelper::loginUser(); - $CC_CONFIG = Config::getConfig(); - $testqry = CcFilesQuery::create(); - $testout = $testqry->find(); - $vd = $testout->getData(); - $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( - $this->getConnection() - ); - $testCriteria = BlockModelData::getCriteriaSingleNewestLabelNada(); - $bltest = new Application_Model_Block(); - $bltest->saveSmartBlockCriteria($testCriteria); - $tracks = $bltest->getListOfFilesUnderLimit(); - //$tracks = $bltest->getLength(); - $this->assertNotEmpty($tracks); - // need to load a example criteria into the database - } - - - /** - * Test if the single newest file is added to the Database - * - */ - - public function testMultiTrackandAlbumsGetLoaded() { - TestHelper::loginUser(); - $CC_CONFIG = Config::getConfig(); - $testqry = CcFilesQuery::create(); - $testout = $testqry->find(); - $vd = $testout->getData(); - $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( - $this->getConnection() - ); - $testCriteria = BlockModelData::getCriteriaMultiTrackAndAlbum1Hour(); - $bltest = new Application_Model_Block(); - $bltest->saveSmartBlockCriteria($testCriteria); - $tracks = $bltest->getListOfFilesUnderLimit(); - //$tracks = $bltest->getLength(); - $this->assertNotEmpty($tracks); - // add assertion that the length is less than 1 hour... - // need to load a example criteria into the database - } - -} \ No newline at end of file diff --git a/airtime_mvc/tests/application/models/database/ScheduleDbTest.php b/airtime_mvc/tests/application/models/database/ScheduleDbTest.php deleted file mode 100644 index cb8ab4a4c..000000000 --- a/airtime_mvc/tests/application/models/database/ScheduleDbTest.php +++ /dev/null @@ -1,138 +0,0 @@ -appBootstrap(); - - parent::setUp(); - } - - public function appBootstrap() - { - $this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH .'/configs/application.ini'); - $this->application->bootstrap(); - } - - public function getConnection() - { - if ($this->_connectionMock == null) { - $config = TestHelper::getDbZendConfig(); - - $connection = Zend_Db::factory('pdo_pgsql', $config); - - $this->_connectionMock = $this->createZendDbConnection( - $connection, - 'airtimeunittests' - ); - Zend_Db_Table_Abstract::setDefaultAdapter($connection); - } - return $this->_connectionMock; - } - - /* Defines how the initial state of the database should look before each test is executed - * Called once during setUp() and gets recreated for each new test - */ - public function getDataSet() - { - return new PHPUnit_Extensions_Database_DataSet_YamlDataSet( - __DIR__ . '/datasets/seed_schedule.yml' - ); - } - - public function testCheckOverlappingShows() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getOverlappingShowCheckTestData(); - $showService = new Application_Service_ShowService(null, $data); - - /** Create shows to test against **/ - $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 order by id'); - $ds->addTable('cc_show_instances', 'select id, starts, ends, show_id, modified_instance from cc_show_instances order by id'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - /** Make sure shows were created correctly **/ - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_checkOverlappingShows.yml"), - $ds - ); - - $utcTimezone = new DateTimeZone("UTC"); - - /** Test that overlapping check works when creating a new show **/ - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-02-01 00:00:00", $utcTimezone), - new DateTime("2014-02-01 01:00:00", $utcTimezone) - ); - $this->assertEquals($overlapping, false); - - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-05 00:00:00", $utcTimezone), - new DateTime("2014-01-05 02:00:00", $utcTimezone) - ); - $this->assertEquals($overlapping, true); - - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-05 01:00:00", $utcTimezone), - new DateTime("2014-01-05 02:00:00", $utcTimezone) - ); - $this->assertEquals($overlapping, false); - - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-31 00:30:00", $utcTimezone), - new DateTime("2014-01-31 01:30:00", $utcTimezone) - ); - $this->assertEquals($overlapping, true); - - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-20 23:55:00", $utcTimezone), - new DateTime("2014-01-21 00:00:05", $utcTimezone) - ); - $this->assertEquals($overlapping, true); - - /** Test overlapping check works when editing an entire show **/ - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-05 00:00:00", $utcTimezone), - new DateTime("2014-01-05 02:00:00", $utcTimezone), - true, - null, - 1 - ); - $this->assertEquals($overlapping, false); - - /** Delete a repeating instance, create a new show in it's place and - * test if we can modify the repeating show after **/ - $ccShowInstance = CcShowInstancesQuery::create()->findPk(1); - $ccShowInstance->setDbModifiedInstance(true)->save(); - - $newShowData = ShowServiceData::getNoRepeatNoRRData(); - $newShowData["add_show_start_date"] = "2014-01-05"; - $newShowData["add_show_end_date_no_repeat"] = "2014-01-05"; - $newShowData["add_show_end_date"] = "2014-01-05"; - - $showService->addUpdateShow($newShowData); - - $overlapping = Application_Model_Schedule::checkOverlappingShows( - new DateTime("2014-01-06 00:00:00", $utcTimezone), - new DateTime("2014-01-06 00:30:00", $utcTimezone), - true, - null, - 1 - ); - $this->assertEquals($overlapping, false); - } -} \ No newline at end of file diff --git a/airtime_mvc/tests/application/models/database/datasets/seed_files.yml b/airtime_mvc/tests/application/models/database/datasets/seed_files.yml deleted file mode 100644 index c29094a97..000000000 --- a/airtime_mvc/tests/application/models/database/datasets/seed_files.yml +++ /dev/null @@ -1,177 +0,0 @@ - -cc_music_dirs: - - - id: '1' - directory: '/tmp/libretime-test' - type: 'stor' - exists: 't' - watched: 't' - - -cc_files: - - - id: '1' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/oneminute.mp3' - mtime: '2017-08-06 04:27:36' - utime: '2017-08-06 04:26:47' - track_title: 'oneminute.mp3' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:00' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '2586748' - - - - id: '2' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/fiveminute.mp3' - mtime: '2017-08-06 04:28:36' - utime: '2017-08-06 04:27:47' - track_title: 'fiveminute.mp3' - bit_rate: '320000' - sample_rate: '44100' - length: '00:05:00' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - - - - id: '3' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/track1.mp3' - mtime: '2017-08-06 04:28:36' - utime: '2017-08-06 04:27:47' - track_title: 'track1' - album_title: 'album1' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:30' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - - - id: '4' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/track2.mp3' - mtime: '2017-08-06 04:28:36' - utime: '2017-08-06 04:27:47' - track_title: 'track2' - album_title: 'album1' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:30' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - - id: '5' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/track3.mp3' - mtime: '2017-08-06 04:28:36' - utime: '2017-08-06 04:27:47' - track_title: 'track3' - album_title: 'album1' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:30' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - - - - id: '6' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/track1-2.mp3' - mtime: '2017-08-06 05:28:36' - utime: '2017-08-16 04:27:47' - track_title: 'track1' - album_title: 'album2' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:30' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - - - id: '7' - mime: 'audio/mp3' - ftype: 'audioclip' - directory: '1' - filepath: 'imported/1/track2-2.mp3' - mtime: '2017-08-06 04:28:36' - utime: '2017-08-06 04:27:47' - track_title: 'track2' - album_title: 'album2' - bit_rate: '320000' - sample_rate: '44100' - length: '00:01:30' - channels: '2' - genre: 'test' - label: 'nada' - owner_id: '1' - file_exists: 't' - hidden: 'f' - silan_check: 'f' - is_scheduled: 'f' - is_playlist: 'f' - filesize: '5126748' - diff --git a/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml b/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml deleted file mode 100644 index 940d2b9f4..000000000 --- a/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml +++ /dev/null @@ -1,11 +0,0 @@ -cc_pref: - - - id: '1' - subjid: null - keystr: shows_populated_until - valstr: '2014-02-01 00:00:00' - - - id: '2' - subjid: null - keystr: timezone - valstr: UTC diff --git a/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml b/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml deleted file mode 100644 index 1262edf21..000000000 --- a/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml +++ /dev/null @@ -1,270 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2014-01-05' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '0' - repeat_type: '0' - next_pop_date: '2014-02-02' - show_id: '1' - record: '0' - - - id: '2' - first_show: '2014-01-06' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '1' - repeat_type: '0' - next_pop_date: '2014-02-03' - show_id: '1' - record: '0' - - - id: '3' - first_show: '2014-01-07' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '2' - repeat_type: '0' - next_pop_date: '2014-02-04' - show_id: '1' - record: '0' - - - id: '4' - first_show: '2014-01-08' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '3' - repeat_type: '0' - next_pop_date: '2014-02-05' - show_id: '1' - record: '0' - - - id: '5' - first_show: '2014-01-09' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '4' - repeat_type: '0' - next_pop_date: '2014-02-06' - show_id: '1' - record: '0' - - - id: '6' - first_show: '2014-01-10' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2014-02-07' - show_id: '1' - record: '0' - - - id: '7' - first_show: '2014-01-11' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '6' - repeat_type: '0' - next_pop_date: '2014-02-01' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2014-01-05 00:00:00' - ends: '2014-01-05 01:00:00' - show_id: '1' - modified_instance: false - - - id: '2' - starts: '2014-01-12 00:00:00' - ends: '2014-01-12 01:00:00' - show_id: '1' - modified_instance: false - - - id: '3' - starts: '2014-01-19 00:00:00' - ends: '2014-01-19 01:00:00' - show_id: '1' - modified_instance: false - - - id: '4' - starts: '2014-01-26 00:00:00' - ends: '2014-01-26 01:00:00' - show_id: '1' - modified_instance: false - - - id: '5' - starts: '2014-01-06 00:00:00' - ends: '2014-01-06 01:00:00' - show_id: '1' - modified_instance: false - - - id: '6' - starts: '2014-01-13 00:00:00' - ends: '2014-01-13 01:00:00' - show_id: '1' - modified_instance: false - - - id: '7' - starts: '2014-01-20 00:00:00' - ends: '2014-01-20 01:00:00' - show_id: '1' - modified_instance: false - - - id: '8' - starts: '2014-01-27 00:00:00' - ends: '2014-01-27 01:00:00' - show_id: '1' - modified_instance: false - - - id: '9' - starts: '2014-01-07 00:00:00' - ends: '2014-01-07 01:00:00' - show_id: '1' - modified_instance: false - - - id: '10' - starts: '2014-01-14 00:00:00' - ends: '2014-01-14 01:00:00' - show_id: '1' - modified_instance: false - - - id: '11' - starts: '2014-01-21 00:00:00' - ends: '2014-01-21 01:00:00' - show_id: '1' - modified_instance: false - - - id: '12' - starts: '2014-01-28 00:00:00' - ends: '2014-01-28 01:00:00' - show_id: '1' - modified_instance: false - - - id: '13' - starts: '2014-01-08 00:00:00' - ends: '2014-01-08 01:00:00' - show_id: '1' - modified_instance: false - - - id: '14' - starts: '2014-01-15 00:00:00' - ends: '2014-01-15 01:00:00' - show_id: '1' - modified_instance: false - - - id: '15' - starts: '2014-01-22 00:00:00' - ends: '2014-01-22 01:00:00' - show_id: '1' - modified_instance: false - - - id: '16' - starts: '2014-01-29 00:00:00' - ends: '2014-01-29 01:00:00' - show_id: '1' - modified_instance: false - - - id: '17' - starts: '2014-01-09 00:00:00' - ends: '2014-01-09 01:00:00' - show_id: '1' - modified_instance: false - - - id: '18' - starts: '2014-01-16 00:00:00' - ends: '2014-01-16 01:00:00' - show_id: '1' - modified_instance: false - - - id: '19' - starts: '2014-01-23 00:00:00' - ends: '2014-01-23 01:00:00' - show_id: '1' - modified_instance: false - - - id: '20' - starts: '2014-01-30 00:00:00' - ends: '2014-01-30 01:00:00' - show_id: '1' - modified_instance: false - - - id: '21' - starts: '2014-01-10 00:00:00' - ends: '2014-01-10 01:00:00' - show_id: '1' - modified_instance: false - - - id: '22' - starts: '2014-01-17 00:00:00' - ends: '2014-01-17 01:00:00' - show_id: '1' - modified_instance: false - - - id: '23' - starts: '2014-01-24 00:00:00' - ends: '2014-01-24 01:00:00' - show_id: '1' - modified_instance: false - - - id: '24' - starts: '2014-01-31 00:00:00' - ends: '2014-01-31 01:00:00' - show_id: '1' - modified_instance: false - - - id: '25' - starts: '2014-01-11 00:00:00' - ends: '2014-01-11 01:00:00' - show_id: '1' - modified_instance: false - - - id: '26' - starts: '2014-01-18 00:00:00' - ends: '2014-01-18 01:00:00' - show_id: '1' - modified_instance: false - - - id: '27' - starts: '2014-01-25 00:00:00' - ends: '2014-01-25 01:00:00' - show_id: '1' - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php b/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php deleted file mode 100644 index c27f8453d..000000000 --- a/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php +++ /dev/null @@ -1,21 +0,0 @@ -assertEquals(Application_Model_Preference::GetShowsPopulatedUntil(), $date); - } - -} diff --git a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php deleted file mode 100644 index 2c9921bf3..000000000 --- a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php +++ /dev/null @@ -1,78 +0,0 @@ -add(new DateInterval('P1Y')); //1 year into the future - $futureDateString = $futureDate->format('Y-m-d'); - - $testShowData["add_show_start_date"] = $futureDateString; - $testShowData["add_show_end_date"] = $futureDateString; - $testShowData["add_show_end_date_no_repeat"] = $futureDateString; - - //Fudge the "populated until" date to workaround and issue where the default - //value will prevent anything from actually being scheduled. Normally this isn't - //a problem because as soon as you view the calendar for the first time, this is - //set to a week ahead in the future. - $populateUntil = new DateTime("now", new DateTimeZone('UTC')); - $populateUntil = $populateUntil->add(new DateInterval("P2Y")); //2 years ahead in the future. - Application_Model_Preference::SetShowsPopulatedUntil($populateUntil); - - //$showService->setCcShow($testShowData); //Denise says this is not needed. - $showService->addUpdateShow($testShowData); //Create show instances - - // Moved creation of stor directory to TestHelper for setup - - // Insert a fake file into the database - $request = $this->getRequest(); - $params = $request->getParams(); - $params['action'] = ''; - $params['api_key'] = $CC_CONFIG["apiKey"][0]; - $request->setParams($params); - - $metadata = array("MDATA_KEY_FILEPATH" => "/tmp/foobar.mp3", - "MDATA_KEY_DURATION" => "00:01:00", - "is_record" => false); - - //Create the file in the database via the HTTP API. - $apiController = new ApiController($this->request, $this->getResponse()); - $results = $apiController->dispatchMetadata($metadata, "create"); - $fileId = $results["fileid"]; - $this->assertNotEquals($fileId, -1); - $this->assertEquals($fileId, 1); - - //The file should not be scheduled in the future (or at all) at this point - $scheduleModel = new Application_Model_Schedule(); - $scheduleModel->IsFileScheduledInTheFuture($fileId); - $this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), false); - - //Schedule the fake file in the test show, which should be in the future. - $showInstance = new Application_Model_ShowInstance(1); - $showInstance->addFileToShow($fileId); - - //Test the function we actually want to test. :-) - $this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), true); - } -} - diff --git a/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php b/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php deleted file mode 100644 index cea84434f..000000000 --- a/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php +++ /dev/null @@ -1,698 +0,0 @@ -_nowDT = new DateTime("now", new DateTimeZone("UTC")); - - parent::setUp(); - } - - public function getConnection() - { - if ($this->_connectionMock == null) { - $config = TestHelper::getDbZendConfig(); - - $connection = Zend_Db::factory('pdo_pgsql', $config); - - $this->_connectionMock = $this->createZendDbConnection( - $connection, - 'airtimeunittests' - ); - Zend_Db_Table_Abstract::setDefaultAdapter($connection); - } - return $this->_connectionMock; - } - - /* Defines how the initial state of the database should look before each test is executed - * Called once during setUp() and gets recreated for each new test - */ - public function getDataSet() - { - return new PHPUnit_Extensions_Database_DataSet_YamlDataSet( - __DIR__ . '/datasets/seed_show_service.yml' - ); - } - - public function testCcShowInsertedIntoDatabase() - { - $showService = new Application_Service_ShowService(); - - $data = array( - "add_show_id" => -1, - "add_show_name" => "test show", - "add_show_description" => null, - "add_show_url" => null, - "add_show_genre" => null, - "add_show_color" => "ffffff", - "add_show_background_color" => "364492", - "cb_airtime_auth" => false, - "cb_custom_auth" => false, - "custom_username" => null, - "custom_password" => null, - "add_show_linked" => false, - "add_show_has_autoplaylist" => 0, - "add_show_autoplaylist_id" => null, - "add_show_autoplaylist_repeat" => 0 - ); - - $showService->setCcShow($data); - - $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( - $this->getConnection() - ); - $ds->addTable('cc_show', 'select * from cc_show'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_ccShowInsertedIntoDatabase.yml"), - $ds - ); - } - - /* Tests that a non-repeating, non-record, and non-rebroadcast show - * gets created properly - */ - public function testCreateNoRepeatNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getNoRepeatNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createNoRepeatNoRRShow.yml'), - $ds - ); - } - - /* Tests that a weekly repeating, non-record, non-rebroadcast show - * with no end date gets created correctly - */ - public function testCreateWeeklyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml'), - $ds - ); - } - - public function testCreateBiWeeklyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "1"; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml'), - $ds - ); - } - - public function testCreateTriWeeklyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "4"; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml'), - $ds - ); - } - - public function testCreateQuadWeeklyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "5"; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml"), - $ds - ); - } - - public function testCreateMonthlyMonthlyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "2"; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml"), - $ds - ); - } - - public function testCreateMonthlyWeeklyRepeatNoEndNoRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "3"; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml"), - $ds - ); - } - - /* Tests that a show instance gets deleted from it's repeating sequence properly - */ - public function testDeleteShowInstance() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $service_show = new Application_Service_ShowService(null, $data); - $service_show->addUpdateShow($data); - $service_show->deleteShow(3, true); - - $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'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstance.yml"), - $ds - ); - } - - /* Tests that when a user selects 'Delete this instance and all following - * on the calendar the database gets updated correctly - */ - public function testDeleteShowInstanceAndAllFollowing() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_day_check"] = array(5,1,2); - - $service_show = new Application_Service_ShowService(null, $data); - $service_show->addUpdateShow($data); - //delete some single instances first - $service_show->deleteShow(1, true); - $service_show->deleteShow(6, true); - $service_show->deleteShow(8, true); - //delete all instances including and after where id=4 - $service_show->deleteShow(4); - - $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 order by first_show'); - $ds->addTable('cc_show_instances', 'select id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances order by id'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstanceAndAllFollowing.yml"), - $ds - ); - } - - public function testEditRepeatingShowInstance() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - - $showService->addUpdateShow($data); - //move the start date forward one week and the start time forward one hour - $editData = ShowServiceData::getEditRepeatInstanceData(); - - //need to create a new service so it gets constructed with the new data - $showService = new Application_Service_ShowService(null, $editData); - $showService->editRepeatingShowInstance($editData); - - $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'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowInstance.yml"), - $ds - ); - } - - /* Tests the entire show gets deleted when the user selects 'Delete this - * instance and all following' from the context menu on the calendar - */ - public function testDeleteRepeatingShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - - $showService->addUpdateShow($data); - $showService->deleteShow(1); - - $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'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteRepeatingShow.yml"), - $ds - ); - } - - public function testRepeatShowCreationWhenUserMovesForwardInCalendar() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_repeat_type"] = "1"; - $showService = new Application_Service_ShowService(null, $data); - - $showService->addUpdateShow($data); - - //simulate the user moves forward in the calendar - $end = new DateTime("2044-03-12", new DateTimeZone("UTC")); - $showService->delegateInstanceCreation(null, $end, true); - - $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'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml"), - $ds - ); - } - - public function testLinkedShow() - { - TestHelper::loginUser(); - - /** Test creating a linked show **/ - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_linked"] = 1; - $showService = new Application_Service_ShowService(null, $data); - - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createLinkedShow.yml"), - $ds - ); - } - - /** Test the creation of a single record and rebroadcast(RR) show **/ - public function testCreateNoRepeatRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getNoRepeatRRData(); - $showService = new Application_Service_ShowService(null, $data); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createNoRepeatRRShow.yml"), - $ds - ); - } - - /** Test the creation of a weekly repeating, record and rebroadcast(RR) show **/ - public function testCreateWeeklyRepeatRRShow() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatRRData(); - $showService = new Application_Service_ShowService(null, $data); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createWeeklyRepeatRRShow.yml"), - $ds - ); - } - - public function testEditRepeatingShowChangeNoEndOption() - { - TestHelper::loginUser(); - - /** Test changing the no end option on a weekly repeating show **/ - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - $data["add_show_end_date"] = '2044-01-09'; - $data["add_show_no_end"] = 0; - $data["add_show_id"] = 1; - - $showService = new Application_Service_ShowService(null, $data, true); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowChangeNoEndOption.yml"), - $ds - ); - } - - /** - * Tests that when you remove the first repeat show day, which changes - * the show's first instance start date, updates the scheduled content - * correctly - */ - public function testRemoveFirstRepeatShowDayUpdatesScheduleCorrectly() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_start_date"] = "2044-01-29"; - $data["add_show_day_check"] = array(5,6); - $data["add_show_linked"] = 1; - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - //insert some fake tracks into cc_schedule table - $ccFiles = new CcFiles(); - $ccFiles - ->setDbCueIn("00:00:00") - ->setDbCueOut("00:04:32") - ->save(); - - $scheduleItems = array( - 0 => array( - "id" => 0, - "instance" => 1, - "timestamp" => time() - ) - ); - $mediaItems = array( - 0 => array( - "id" => 1, - "type" => "audioclip" - ) - ); - $scheduler = new Application_Model_Scheduler(); - $scheduler->scheduleAfter($scheduleItems, $mediaItems); - - //delete the first repeat day - $data["add_show_day_check"] = array(6); - $data["add_show_id"] = 1; - $showService = new Application_Service_ShowService(null, $data, true); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - $ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml"), - $ds - ); - } - - public function testChangeRepeatDayUpdatesScheduleCorrectly() - { - TestHelper::loginUser(); - - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $data["add_show_start_date"] = "2044-01-29"; - $data["add_show_day_check"] = array(5, 6); - $data["add_show_linked"] = 1; - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - //insert some fake tracks into cc_schedule table - $ccFiles = new CcFiles(); - $ccFiles - ->setDbCueIn("00:00:00") - ->setDbCueOut("00:04:32") - ->save(); - - $scheduleItems = array( - 0 => array( - "id" => 0, - "instance" => 1, - "timestamp" => time() - ) - ); - $mediaItems = array( - 0 => array( - "id" => 1, - "type" => "audioclip" - ) - ); - $scheduler = new Application_Model_Scheduler(); - $scheduler->scheduleAfter($scheduleItems, $mediaItems); - - //delete the first repeat day - $data["add_show_day_check"] = array(6); - $data["add_show_id"] = 1; - $showService = new Application_Service_ShowService(null, $data, true); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances'); - $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); - $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); - $ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule'); - - $this->assertDataSetsEqual( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml"), - $ds - ); - } - - public function testChangeRepeatTypeFromWeeklyToNoRepeat() - { - TestHelper::loginUser(); - - //test change repeat type from weekly to no-repeat - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - $data["add_show_repeats"] = 0; - $data["add_show_id"] = 1; - $showService = new Application_Service_ShowService(null, $data, true); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToNoRepeat.yml"), - $ds - ); - } - - public function testChangeRepeatTypeFromWeeklyToBiWeekly() - { - TestHelper::loginUser(); - - //test change repeat type weekly to bi-weekly - $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); - $showService = new Application_Service_ShowService(null, $data); - $showService->addUpdateShow($data); - - $data["add_show_id"] = 1; - $data["add_show_repeat_type"] = 1; - $showService = new Application_Service_ShowService(null, $data, true); - $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( - new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToBiWeekly.yml"), - $ds - ); - } -} diff --git a/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml b/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml deleted file mode 100644 index e91a6b8e7..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml +++ /dev/null @@ -1,11 +0,0 @@ -cc_pref: - - - id: '1' - subjid: null - keystr: shows_populated_until - valstr: '2044-02-07 00:00:00' - - - id: '2' - subjid: null - keystr: timezone - valstr: UTC diff --git a/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml b/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml deleted file mode 100644 index f8febec14..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml +++ /dev/null @@ -1,19 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false diff --git a/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml b/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml deleted file mode 100644 index 653735f43..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml +++ /dev/null @@ -1,79 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: true - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '2' - first_show: '2044-01-30' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '6' - repeat_type: '0' - next_pop_date: '2044-02-13' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '3' - starts: '2044-01-30 00:00:00' - ends: '2044-01-30 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-02-06 00:00:00' - ends: '2044-02-06 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_schedule: - - - id: '3' - starts: '2044-01-30 00:00:00' - ends: '2044-01-30 00:04:32' - file_id: '1' - clip_length: '00:04:32' - fade_in: '00:00:00.5' - fade_out: '00:00:00.5' - cue_in: '00:00:00' - cue_out: '00:04:32' - instance_id: '3' - playout_status: '1' - - - id: '4' - starts: '2044-02-06 00:00:00' - ends: '2044-02-06 00:04:32' - file_id: '1' - clip_length: '00:04:32' - fade_in: '00:00:00.5' - fade_out: '00:00:00.5' - cue_in: '00:00:00' - cue_out: '00:04:32' - instance_id: '4' - playout_status: '1' -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml deleted file mode 100644 index 9d9b152c1..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,63 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '1' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml deleted file mode 100644 index d215b40d7..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml +++ /dev/null @@ -1,90 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: true - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml deleted file mode 100644 index 5aaa9417a..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,54 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: null - repeat_type: '2' - next_pop_date: '2044-03-01' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-02-01 00:00:00' - ends: '2044-02-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml deleted file mode 100644 index 5d7b10f43..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,54 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '3' - next_pop_date: '2044-03-04' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml deleted file mode 100644 index 029eb78de..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml +++ /dev/null @@ -1,45 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '-1' - next_pop_date: '2044-01-01' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml deleted file mode 100644 index 05ddeec2d..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml +++ /dev/null @@ -1,185 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '-1' - next_pop_date: '2044-01-01' - show_id: '1' - record: '1' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-02 00:00:00' - ends: '2044-01-02 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '3' - starts: '2044-01-03 00:00:00' - ends: '2044-01-03 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '4' - starts: '2044-01-04 00:00:00' - ends: '2044-01-04 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '5' - starts: '2044-01-05 00:00:00' - ends: '2044-01-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '6' - starts: '2044-01-06 00:00:00' - ends: '2044-01-06 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '7' - starts: '2044-01-07 00:00:00' - ends: '2044-01-07 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '8' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '9' - starts: '2044-01-09 00:00:00' - ends: '2044-01-09 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '10' - starts: '2044-01-10 00:00:00' - ends: '2044-01-10 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '11' - starts: '2044-01-11 00:00:00' - ends: '2044-01-11 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false -cc_show_rebroadcast: - - - id: '1' - day_offset: '1 days' - start_time: '00:00:00' - show_id: '1' - - - id: '2' - day_offset: '2 days' - start_time: '00:00:00' - show_id: '1' - - - id: '3' - day_offset: '3 days' - start_time: '00:00:00' - show_id: '1' - - - id: '4' - day_offset: '4 days' - start_time: '00:00:00' - show_id: '1' - - - id: '5' - day_offset: '5 days' - start_time: '00:00:00' - show_id: '1' - - - id: '6' - day_offset: '6 days' - start_time: '00:00:00' - show_id: '1' - - - id: '7' - day_offset: '7 days' - start_time: '00:00:00' - show_id: '1' - - - id: '8' - day_offset: '8 days' - start_time: '00:00:00' - show_id: '1' - - - id: '9' - day_offset: '9 days' - start_time: '00:00:00' - show_id: '1' - - - id: '10' - day_offset: '10 days' - start_time: '00:00:00' - show_id: '1' -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml deleted file mode 100644 index 8490ed56e..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,54 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '5' - next_pop_date: '2044-02-26' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml deleted file mode 100644 index bffa9fe5f..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,54 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '4' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml deleted file mode 100644 index ebcf284eb..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml +++ /dev/null @@ -1,90 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml deleted file mode 100644 index a7a48b8f2..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml +++ /dev/null @@ -1,208 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '1' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-02 00:00:00' - ends: '2044-01-02 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '3' - starts: '2044-01-03 12:00:00' - ends: '2044-01-03 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '1' - modified_instance: false - - - id: '4' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-09 00:00:00' - ends: '2044-01-09 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '4' - modified_instance: false - - - id: '6' - starts: '2044-01-10 12:00:00' - ends: '2044-01-10 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '4' - modified_instance: false - - - id: '7' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '8' - starts: '2044-01-16 00:00:00' - ends: '2044-01-16 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '7' - modified_instance: false - - - id: '9' - starts: '2044-01-17 12:00:00' - ends: '2044-01-17 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '7' - modified_instance: false - - - id: '10' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '11' - starts: '2044-01-23 00:00:00' - ends: '2044-01-23 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '10' - modified_instance: false - - - id: '12' - starts: '2044-01-24 12:00:00' - ends: '2044-01-24 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '10' - modified_instance: false - - - id: '13' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '14' - starts: '2044-01-30 00:00:00' - ends: '2044-01-30 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '13' - modified_instance: false - - - id: '15' - starts: '2044-01-31 12:00:00' - ends: '2044-01-31 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '13' - modified_instance: false - - - id: '16' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '1' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '17' - starts: '2044-02-06 00:00:00' - ends: '2044-02-06 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '16' - modified_instance: false - - - id: '18' - starts: '2044-02-07 12:00:00' - ends: '2044-02-07 13:00:00' - show_id: '1' - record: '0' - rebroadcast: '1' - instance_id: '16' - modified_instance: false -cc_show_rebroadcast: - - - id: '1' - day_offset: '1 days' - start_time: '00:00:00' - show_id: '1' - - - id: '2' - day_offset: '2 days' - start_time: '12:00:00' - show_id: '1' -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml deleted file mode 100644 index 3f8801b58..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml +++ /dev/null @@ -1,6 +0,0 @@ -cc_show: -cc_show_days: -cc_show_instances: -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml deleted file mode 100644 index d55a468e5..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml +++ /dev/null @@ -1,90 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml deleted file mode 100644 index 20e4ae2f0..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml +++ /dev/null @@ -1,204 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: '2044-01-16' - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' - - - id: '2' - first_show: '2044-01-04' - last_show: '2044-01-19' - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '1' - repeat_type: '0' - next_pop_date: '2044-02-08' - show_id: '1' - record: '0' - - - id: '3' - first_show: '2044-01-05' - last_show: '2044-01-20' - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '2' - repeat_type: '0' - next_pop_date: '2044-02-09' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '7' - starts: '2044-01-04 00:00:00' - ends: '2044-01-04 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '8' - starts: '2044-01-11 00:00:00' - ends: '2044-01-11 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '9' - starts: '2044-01-18 00:00:00' - ends: '2044-01-18 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '10' - starts: '2044-01-25 00:00:00' - ends: '2044-01-25 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '11' - starts: '2044-02-01 00:00:00' - ends: '2044-02-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '12' - starts: '2044-01-05 00:00:00' - ends: '2044-01-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '13' - starts: '2044-01-12 00:00:00' - ends: '2044-01-12 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '14' - starts: '2044-01-19 00:00:00' - ends: '2044-01-19 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '15' - starts: '2044-01-26 00:00:00' - ends: '2044-01-26 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '16' - starts: '2044-02-02 00:00:00' - ends: '2044-02-02 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml deleted file mode 100644 index 21005aabe..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml +++ /dev/null @@ -1,54 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: '2044-01-10' - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-01-15' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml deleted file mode 100644 index 8b41176e6..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml +++ /dev/null @@ -1,111 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' - - - id: '2' - first_show: '2044-01-08' - last_show: '2044-01-09' - start_time: '01:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '-1' - next_pop_date: '2044-01-08' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: true - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '7' - starts: '2044-01-08 01:00:00' - ends: '2044-01-08 02:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml b/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml deleted file mode 100644 index 653735f43..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml +++ /dev/null @@ -1,79 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: true - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '2' - first_show: '2044-01-30' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '6' - repeat_type: '0' - next_pop_date: '2044-02-13' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '3' - starts: '2044-01-30 00:00:00' - ends: '2044-01-30 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-02-06 00:00:00' - ends: '2044-02-06 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_schedule: - - - id: '3' - starts: '2044-01-30 00:00:00' - ends: '2044-01-30 00:04:32' - file_id: '1' - clip_length: '00:04:32' - fade_in: '00:00:00.5' - fade_out: '00:00:00.5' - cue_in: '00:00:00' - cue_out: '00:04:32' - instance_id: '3' - playout_status: '1' - - - id: '4' - starts: '2044-02-06 00:00:00' - ends: '2044-02-06 00:04:32' - file_id: '1' - clip_length: '00:04:32' - fade_in: '00:00:00.5' - fade_out: '00:00:00.5' - cue_in: '00:00:00' - cue_out: '00:04:32' - instance_id: '4' - playout_status: '1' -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml b/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml deleted file mode 100644 index 88ccf868f..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml +++ /dev/null @@ -1,90 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '1' - next_pop_date: '2044-03-25' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-02-12 00:00:00' - ends: '2044-02-12 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-02-26 00:00:00' - ends: '2044-02-26 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-03-11 00:00:00' - ends: '2044-03-11 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml deleted file mode 100644 index a3ebb56f4..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml +++ /dev/null @@ -1,90 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: false - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '1' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '0' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '2' - starts: '2044-01-08 00:00:00' - ends: '2044-01-08 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '3' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '4' - starts: '2044-01-22 00:00:00' - ends: '2044-01-22 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '5' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '6' - starts: '2044-02-05 00:00:00' - ends: '2044-02-05 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml deleted file mode 100644 index ee630e54c..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml +++ /dev/null @@ -1,63 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '2' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '1' - next_pop_date: '2044-02-12' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '7' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '8' - starts: '2044-01-15 00:00:00' - ends: '2044-01-15 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false - - - id: '9' - starts: '2044-01-29 00:00:00' - ends: '2044-01-29 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml deleted file mode 100644 index 619f172e3..000000000 --- a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml +++ /dev/null @@ -1,45 +0,0 @@ -cc_show: - - - id: '1' - name: 'test show' - url: null - genre: null - description: null - color: ffffff - background_color: '364492' - live_stream_using_airtime_auth: false - live_stream_using_custom_auth: false - live_stream_user: null - live_stream_pass: null - linked: false - is_linkable: true - image_path: '' - has_autoplaylist: false - autoplaylist_id: null - autoplaylist_repeat: false -cc_show_days: - - - id: '2' - first_show: '2044-01-01' - last_show: null - start_time: '00:00:00' - timezone: UTC - duration: '01:00' - day: '5' - repeat_type: '-1' - next_pop_date: '2044-01-01' - show_id: '1' - record: '0' -cc_show_instances: - - - id: '1' - starts: '2044-01-01 00:00:00' - ends: '2044-01-01 01:00:00' - show_id: '1' - record: '0' - rebroadcast: '0' - instance_id: null - modified_instance: false -cc_show_rebroadcast: -cc_show_hosts: - diff --git a/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php b/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php deleted file mode 100644 index 0e70df10c..000000000 --- a/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php +++ /dev/null @@ -1,139 +0,0 @@ -_reflectionOfShowService = new ReflectionClass('Application_Service_ShowService'); - - $this->_showService = new Application_Service_ShowService(); - } - - public function testFormatShowDuration() - { - $duration = Application_Service_ShowService::formatShowDuration("01h 00m"); - $this->assertEquals("01:00", $duration); - - $duration = Application_Service_ShowService::formatShowDuration("00h 05m"); - $this->assertEquals("00:05", $duration); - - $duration = Application_Service_ShowService::formatShowDuration("03h 55m"); - $this->assertEquals("03:55", $duration); - } - - public function testCalculateEndDate() - { - $method = $this->_reflectionOfShowService->getMethod('calculateEndDate'); - $method->setAccessible(true); - - $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getNoRepeatNoRRData())); - $this->assertEquals(null, $end); - - $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatWithEndNoRRData())); - $this->assertEquals(new DateTime("2044-01-27", new DateTimeZone("UTC")), $end); - - $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatNoEndNoRRData())); - $this->assertEquals(null, $end); - } - - public function testGetMonthlyWeeklyRepeatInterval() - { - $method = $this->_reflectionOfShowService->getMethod('getMonthlyWeeklyRepeatInterval'); - $method->setAccessible(true); - - $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), new DateTimeZone("UTC"))); - $this->assertEquals(array("first", "Friday"), $repeatInterval); - - $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-12"), new DateTimeZone("UTC"))); - $this->assertEquals(array("second", "Tuesday"), $repeatInterval); - - $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-18"), new DateTimeZone("UTC"))); - $this->assertEquals(array("third", "Monday"), $repeatInterval); - - $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-28"), new DateTimeZone("UTC"))); - $this->assertEquals(array("fourth", "Thursday"), $repeatInterval); - - $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), new DateTimeZone("UTC"))); - $this->assertEquals(array("fifth", "Saturday"), $repeatInterval); - } - - public function testGetNextMonthlyMonthlyRepeatDate() - { - $method = $this->_reflectionOfShowService->getMethod('getNextMonthlyMonthlyRepeatDate'); - $method->setAccessible(true); - - $next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), "UTC", "00:00")); - $this->assertEquals(new DateTime("2044-02-01", new DateTimeZone("UTC")), $next); - - $next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), "UTC", "00:00")); - $this->assertEquals(new DateTime("2044-03-30", new DateTimeZone("UTC")), $next); - } - - public function testGetNextMonthlyWeeklyRepeatDate() - { - $method = $this->_reflectionOfShowService->getMethod('getNextMonthlyWeeklyRepeatDate'); - $method->setAccessible(true); - - $next = $method->invokeArgs($this->_showService, array( - new DateTime("2044-02-01"), "UTC", "00:00", "first", "Friday")); - $this->assertEquals(new DateTime("2044-02-05", new DateTimeZone("UTC")), $next); - - $next = $method->invokeArgs($this->_showService, array( - new DateTime("2044-02-01"), "UTC", "00:00", "fifth", "Saturday")); - $this->assertEquals(new DateTime("2044-04-30", new DateTimeZone("UTC")), $next); - - $next = $method->invokeArgs($this->_showService, array( - new DateTime("2044-02-01"), "UTC", "00:00", "fourth", "Monday")); - $this->assertEquals(new DateTime("2044-02-22", new DateTimeZone("UTC")), $next); - } - - public function testCreateUTCStartEndDateTime() - { - $method = $this->_reflectionOfShowService->getMethod('createUTCStartEndDateTime'); - $method->setAccessible(true); - - $utcTimezone = new DateTimeZone("UTC"); - - //America/Toronto - $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto")); - $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto")); - - $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); - $this->assertEquals(array( - $localStartDT->setTimezone($utcTimezone),$localEndDT->setTimezone($utcTimezone)), $dt); - - //America/Toronto with offset for rebroadcast shows - $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto")); - $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto")); - - $localRebroadcastStartDT = new DateTime("2044-01-02 06:30", new DateTimeZone("America/Toronto")); - $localRebroadcastEndDT = new DateTime("2044-01-02 07:30", new DateTimeZone("America/Toronto")); - - $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00", - array("days" => "1", "hours" => "06", "mins" => "30"))); - $this->assertEquals(array( - $localRebroadcastStartDT->setTimezone($utcTimezone),$localRebroadcastEndDT->setTimezone($utcTimezone)), $dt); - - //Australia/Brisbane - $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("Australia/Brisbane")); - $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("Australia/Brisbane")); - - $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); - $this->assertEquals(array( - $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt); - - //America/Vancouver - $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Vancouver")); - $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Vancouver")); - - $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); - $this->assertEquals(array( - $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt); - } -} diff --git a/airtime_mvc/tests/application/testdata/BlockModelData.php b/airtime_mvc/tests/application/testdata/BlockModelData.php deleted file mode 100644 index 7a755f3a8..000000000 --- a/airtime_mvc/tests/application/testdata/BlockModelData.php +++ /dev/null @@ -1,51 +0,0 @@ - "sp_type", "value" => 0), - Array("name" => "sp_type", "value" => 0), - Array("name" => "sp_repeat_tracks", "value" => 0), - Array("name" => "sp_sort_options", "value" => "newest"), - Array("name" => "sp_limit_value", "value" => 1), - Array("name" => "sp_limit_options", "value" => "items"), - Array("name" => "sp_criteria_field_0_0", "value" => "label"), - Array("name" => "sp_criteria_modifier_0_0", "value" => "contains"), - Array("name" => "sp_criteria_value_0_0", "value" => "nada"), - Array("name" => "sp_overflow_tracks", "value" => 0), - ); - } - - - public static function getCriteriaMultiTrackAndAlbum1Hour() - { - return array ( - Array("name" => "sp_type" , "value" => 1), - Array("name" => "sp_repeat_tracks", "value" => 0), - Array("name" => "sp_sort_options", "value" => "random"), - Array("name" => "sp_limit_value", "value" => 1), - Array("name" => "sp_limit_options", "value" => "hours"), - Array("name" => "sp_overflow_tracks", "value" => 0), - Array("name" => "sp_criteria_field_0_0", "value" => "album_title"), - Array("name" => "sp_criteria_modifier_0_0", "value" => "is"), - Array("name" => "sp_criteria_value_0_0", "value" => "album1"), - Array("name" => "sp_criteria_field_0_1", "value" => "album_title"), - Array("name" => "sp_criteria_modifier_0_1", "value" => "is"), - Array("name" => "sp_criteria_value_0_1", "value" => "album2"), - Array("name" => "sp_criteria_field_1_0", "value" => "track_title"), - Array("name" => "sp_criteria_modifier_1_0", "value" => "is"), - Array("name" => "sp_criteria_value_1_0", "value" => "track1"), - Array("name" => "sp_criteria_field_1_1", "value" => "track_title"), - Array("name" => "sp_criteria_modifier_1_1", "value" => "is"), - Array("name" => "sp_criteria_value_1_1", "value" => "track2"), - Array("name" => "sp_criteria_field_1_2", "value" => "track_title"), - Array("name" => "sp_criteria_modifier_1_2", "value" => "is"), - Array("name" => "sp_criteria_value_1_2", "value" => "track3"), - Array("name" => "sp_criteria_field_2_0", "value" => "length"), - Array("name" => "sp_criteria_modifier_2_0", "value" => "is greater than"), - Array("name" => "sp_criteria_value_2_0", "value" => "00:01:00"), - ); - - } -} \ No newline at end of file diff --git a/airtime_mvc/tests/application/testdata/ShowServiceData.php b/airtime_mvc/tests/application/testdata/ShowServiceData.php deleted file mode 100644 index ca3c1019d..000000000 --- a/airtime_mvc/tests/application/testdata/ShowServiceData.php +++ /dev/null @@ -1,513 +0,0 @@ - -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2044-01-01", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2044-01-01", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 0, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2044-01-01", - "add_show_no_end" => 1, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 0, - "add_show_rebroadcast" => 0, - "add_show_rebroadcast_date_absolute_1" => null, - "add_show_rebroadcast_time_absolute_1" => null, - "add_show_rebroadcast_date_absolute_2" => null, - "add_show_rebroadcast_time_absolute_2" => null, - "add_show_rebroadcast_date_absolute_3" => null, - "add_show_rebroadcast_time_absolute_3" => null, - "add_show_rebroadcast_date_absolute_4" => null, - "add_show_rebroadcast_time_absolute_4" => null, - "add_show_rebroadcast_date_absolute_5" => null, - "add_show_rebroadcast_time_absolute_5" => null, - "add_show_rebroadcast_date_absolute_6" => null, - "add_show_rebroadcast_time_absolute_6" => null, - "add_show_rebroadcast_date_absolute_7" => null, - "add_show_rebroadcast_time_absolute_7" => null, - "add_show_rebroadcast_date_absolute_8" => null, - "add_show_rebroadcast_time_absolute_8" => null, - "add_show_rebroadcast_date_absolute_9" => null, - "add_show_rebroadcast_time_absolute_9" => null, - "add_show_rebroadcast_date_absolute_10" => null, - "add_show_rebroadcast_time_absolute_10" => null, - "add_show_rebroadcast_date_1" => null, - "add_show_rebroadcast_time_1" => null, - "add_show_rebroadcast_date_2" => null, - "add_show_rebroadcast_time_2" => null, - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => null - ); - } - - public static function getWeeklyRepeatNoEndNoRRData() - { - return array( - "add_show_id" => -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2044-01-01", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2044-01-01", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 1, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2044-01-01", - "add_show_no_end" => 1, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 0, - "add_show_rebroadcast" => 0, - "add_show_rebroadcast_date_absolute_1" => null, - "add_show_rebroadcast_time_absolute_1" => null, - "add_show_rebroadcast_date_absolute_2" => null, - "add_show_rebroadcast_time_absolute_2" => null, - "add_show_rebroadcast_date_absolute_3" => null, - "add_show_rebroadcast_time_absolute_3" => null, - "add_show_rebroadcast_date_absolute_4" => null, - "add_show_rebroadcast_time_absolute_4" => null, - "add_show_rebroadcast_date_absolute_5" => null, - "add_show_rebroadcast_time_absolute_5" => null, - "add_show_rebroadcast_date_absolute_6" => null, - "add_show_rebroadcast_time_absolute_6" => null, - "add_show_rebroadcast_date_absolute_7" => null, - "add_show_rebroadcast_time_absolute_7" => null, - "add_show_rebroadcast_date_absolute_8" => null, - "add_show_rebroadcast_time_absolute_8" => null, - "add_show_rebroadcast_date_absolute_9" => null, - "add_show_rebroadcast_time_absolute_9" => null, - "add_show_rebroadcast_date_absolute_10" => null, - "add_show_rebroadcast_time_absolute_10" => null, - "add_show_rebroadcast_date_1" => null, - "add_show_rebroadcast_time_1" => null, - "add_show_rebroadcast_date_2" => null, - "add_show_rebroadcast_time_2" => null, - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => array(5) - ); - } - - public static function getWeeklyRepeatWithEndNoRRData() - { - return array( - "add_show_id" => -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2044-01-01", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2044-01-01", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 1, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2044-01-26", - "add_show_no_end" => 0, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 0, - "add_show_rebroadcast" => 0, - "add_show_rebroadcast_date_absolute_1" => null, - "add_show_rebroadcast_time_absolute_1" => null, - "add_show_rebroadcast_date_absolute_2" => null, - "add_show_rebroadcast_time_absolute_2" => null, - "add_show_rebroadcast_date_absolute_3" => null, - "add_show_rebroadcast_time_absolute_3" => null, - "add_show_rebroadcast_date_absolute_4" => null, - "add_show_rebroadcast_time_absolute_4" => null, - "add_show_rebroadcast_date_absolute_5" => null, - "add_show_rebroadcast_time_absolute_5" => null, - "add_show_rebroadcast_date_absolute_6" => null, - "add_show_rebroadcast_time_absolute_6" => null, - "add_show_rebroadcast_date_absolute_7" => null, - "add_show_rebroadcast_time_absolute_7" => null, - "add_show_rebroadcast_date_absolute_8" => null, - "add_show_rebroadcast_time_absolute_8" => null, - "add_show_rebroadcast_date_absolute_9" => null, - "add_show_rebroadcast_time_absolute_9" => null, - "add_show_rebroadcast_date_absolute_10" => null, - "add_show_rebroadcast_time_absolute_10" => null, - "add_show_rebroadcast_date_1" => null, - "add_show_rebroadcast_time_1" => null, - "add_show_rebroadcast_date_2" => null, - "add_show_rebroadcast_time_2" => null, - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => array(5) - ); - } - - public static function getWeeklyRepeatDays() - { - return array(1,2,3,4,5); - } - - public static function getDailyRepeatDays() - { - return array(0,1,2,3,4,5,6); - } - - public static function getEditRepeatInstanceData() - { - return array( - "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, - "add_show_start_date" => "2044-01-08", - "add_show_start_time" => "01:00", - "add_show_end_date_no_repeat" => "2044-01-08", - "add_show_end_time" => "02:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 0, - "add_show_linked" => 0, - "add_show_no_end" => 0, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "add_show_record" => 0, - "add_show_rebroadcast" => 0, - "add_show_hosts" => null - ); - } - - public static function getOverlappingShowCheckTestData() - { - return array( - "add_show_id" => -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2014-01-05", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2014-01-05", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 1, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2014-01-05", - "add_show_no_end" => 1, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 0, - "add_show_rebroadcast" => 0, - "add_show_rebroadcast_date_absolute_1" => null, - "add_show_rebroadcast_time_absolute_1" => null, - "add_show_rebroadcast_date_absolute_2" => null, - "add_show_rebroadcast_time_absolute_2" => null, - "add_show_rebroadcast_date_absolute_3" => null, - "add_show_rebroadcast_time_absolute_3" => null, - "add_show_rebroadcast_date_absolute_4" => null, - "add_show_rebroadcast_time_absolute_4" => null, - "add_show_rebroadcast_date_absolute_5" => null, - "add_show_rebroadcast_time_absolute_5" => null, - "add_show_rebroadcast_date_absolute_6" => null, - "add_show_rebroadcast_time_absolute_6" => null, - "add_show_rebroadcast_date_absolute_7" => null, - "add_show_rebroadcast_time_absolute_7" => null, - "add_show_rebroadcast_date_absolute_8" => null, - "add_show_rebroadcast_time_absolute_8" => null, - "add_show_rebroadcast_date_absolute_9" => null, - "add_show_rebroadcast_time_absolute_9" => null, - "add_show_rebroadcast_date_absolute_10" => null, - "add_show_rebroadcast_time_absolute_10" => null, - "add_show_rebroadcast_date_1" => null, - "add_show_rebroadcast_time_1" => null, - "add_show_rebroadcast_date_2" => null, - "add_show_rebroadcast_time_2" => null, - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => array(0,1,2,3,4,5,6) - ); - } - - /** Returns form data for a non-repeating, record and rebroadcast(RR) show **/ - public static function getNoRepeatRRData() - { - return array( - "add_show_id" => -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2044-01-01", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2044-01-01", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 0, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2044-01-01", - "add_show_no_end" => 1, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 1, - "add_show_rebroadcast" => 1, - "add_show_rebroadcast_date_absolute_1" => "2044-01-02", - "add_show_rebroadcast_time_absolute_1" => "00:00", - "add_show_rebroadcast_date_absolute_2" => "2044-01-03", - "add_show_rebroadcast_time_absolute_2" => "00:00", - "add_show_rebroadcast_date_absolute_3" => "2044-01-04", - "add_show_rebroadcast_time_absolute_3" => "00:00", - "add_show_rebroadcast_date_absolute_4" => "2044-01-05", - "add_show_rebroadcast_time_absolute_4" => "00:00", - "add_show_rebroadcast_date_absolute_5" => "2044-01-06", - "add_show_rebroadcast_time_absolute_5" => "00:00", - "add_show_rebroadcast_date_absolute_6" => "2044-01-07", - "add_show_rebroadcast_time_absolute_6" => "00:00", - "add_show_rebroadcast_date_absolute_7" => "2044-01-08", - "add_show_rebroadcast_time_absolute_7" => "00:00", - "add_show_rebroadcast_date_absolute_8" => "2044-01-09", - "add_show_rebroadcast_time_absolute_8" => "00:00", - "add_show_rebroadcast_date_absolute_9" => "2044-01-10", - "add_show_rebroadcast_time_absolute_9" => "00:00", - "add_show_rebroadcast_date_absolute_10" => "2044-01-11", - "add_show_rebroadcast_time_absolute_10" => "00:00", - "add_show_rebroadcast_date_1" => null, - "add_show_rebroadcast_time_1" => null, - "add_show_rebroadcast_date_2" => null, - "add_show_rebroadcast_time_2" => null, - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => null - ); - } - - public static function getWeeklyRepeatRRData() - { - return array( - "add_show_id" => -1, - "add_show_instance_id" => -1, - "add_show_name" => "test show", - "add_show_url" => null, - "add_show_genre" => null, - "add_show_description" => null, - "add_show_start_date" => "2044-01-01", - "add_show_start_time" => "00:00", - "add_show_end_date_no_repeat" => "2044-01-01", - "add_show_end_time" => "01:00", - "add_show_duration" => "01h 00m", - "add_show_timezone" => "UTC", - "add_show_has_autoplaylist" => false, - "add_show_autoplaylist_repeat" => false, - "add_show_autoplaylist_id" => null, - "add_show_repeats" => 1, - "add_show_linked" => 0, - "add_show_repeat_type" => 0, - "add_show_monthly_repeat_type" => 2, - "add_show_end_date" => "2044-01-01", - "add_show_no_end" => 1, - "cb_airtime_auth" => 0, - "cb_custom_auth" => 0, - "custom_username" => null, - "custom_password" => null, - "add_show_record" => 1, - "add_show_rebroadcast" => 1, - "add_show_rebroadcast_date_absolute_1" => null, - "add_show_rebroadcast_time_absolute_1" => null, - "add_show_rebroadcast_date_absolute_2" => null, - "add_show_rebroadcast_time_absolute_2" => null, - "add_show_rebroadcast_date_absolute_3" => null, - "add_show_rebroadcast_time_absolute_3" => null, - "add_show_rebroadcast_date_absolute_4" => null, - "add_show_rebroadcast_time_absolute_4" => null, - "add_show_rebroadcast_date_absolute_5" => null, - "add_show_rebroadcast_time_absolute_5" => null, - "add_show_rebroadcast_date_absolute_6" => null, - "add_show_rebroadcast_time_absolute_6" => null, - "add_show_rebroadcast_date_absolute_7" => null, - "add_show_rebroadcast_time_absolute_7" => null, - "add_show_rebroadcast_date_absolute_8" => null, - "add_show_rebroadcast_time_absolute_8" => null, - "add_show_rebroadcast_date_absolute_9" => null, - "add_show_rebroadcast_time_absolute_9" => null, - "add_show_rebroadcast_date_absolute_10" => null, - "add_show_rebroadcast_time_absolute_10" => null, - "add_show_rebroadcast_date_1" => "1 days", - "add_show_rebroadcast_time_1" => "00:00", - "add_show_rebroadcast_date_2" => "2 days", - "add_show_rebroadcast_time_2" => "12:00", - "add_show_rebroadcast_date_3" => null, - "add_show_rebroadcast_time_3" => null, - "add_show_rebroadcast_date_4" => null, - "add_show_rebroadcast_time_4" => null, - "add_show_rebroadcast_date_5" => null, - "add_show_rebroadcast_time_5" => null, - "add_show_rebroadcast_date_6" => null, - "add_show_rebroadcast_time_6" => null, - "add_show_rebroadcast_date_7" => null, - "add_show_rebroadcast_time_7" => null, - "add_show_rebroadcast_date_8" => null, - "add_show_rebroadcast_time_8" => null, - "add_show_rebroadcast_date_9" => null, - "add_show_rebroadcast_time_9" => null, - "add_show_rebroadcast_date_10" => null, - "add_show_rebroadcast_time_10" => null, - "add_show_hosts_autocomplete" => null, - "add_show_background_color" => "364492", - "add_show_color" => "ffffff", - "add_show_hosts" => null, - "add_show_day_check" => array(5) - ); - } -} diff --git a/airtime_mvc/tests/conf/airtime.conf b/airtime_mvc/tests/conf/airtime.conf deleted file mode 100644 index e64a4b897..000000000 --- a/airtime_mvc/tests/conf/airtime.conf +++ /dev/null @@ -1,51 +0,0 @@ -[database] - -host = localhost -dbname = libretime_test -dbuser = libretime -dbpass = libretime - -[rabbitmq] -host = 127.0.0.1 -port = 5672 -user = airtime_tests -password = airtime_tests -vhost = /airtime_tests - -[general] -dev_env = testing -api_key = H2NRICX6CM8F50CU123C -web_server_user = www-data -airtime_dir = /usr/share/airtime -base_url = localhost -base_port = 80 -base_dir = / -cache_ahead_hours = 1 -station_id = teststation - -[current_backend] -storage_backend=file - -[monit] -monit_user = guest -monit_password = airtime - -[soundcloud] -connection_retries = 3 -time_between_retries = 60 -soundcloud_client_id = 0 -soundcloud_client_secret = 0 -soundcloud_redirect_uri = http://soundcloud.example.org/redirect - -[ldap] -hostname = ldap.example.org -binddn = 'uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org' -password = hackme -account_domain = INT.EXAMPLE.ORG -basedn = 'cn=users,cn=accounts,dc=int,dc=example,dc=org' -filter_field = uid -groupmap_guest = 'cn=guest,cn=groups,cn=accounts,dc=int,dc=example,dc=org' -groupmap_host = 'cn=host,cn=groups,cn=accounts,dc=int,dc=example,dc=org' -groupmap_program_manager = 'cn=program_manager,cn=groups,cn=accounts,dc=int,dc=example,dc=org' -groupmap_admin = 'cn=admins,cn=groups,cn=accounts,dc=int,dc=example,dc=org' -groupmap_superadmin = 'cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org' diff --git a/airtime_mvc/tests/conf/testing/airtime.conf b/airtime_mvc/tests/conf/testing/airtime.conf deleted file mode 100644 index 88930ecf9..000000000 --- a/airtime_mvc/tests/conf/testing/airtime.conf +++ /dev/null @@ -1,35 +0,0 @@ -[database] - -host = localhost -dbname = libretime_test -dbuser = libretime -dbpass = libretime - -[rabbitmq] -host = 127.0.0.1 -port = 5672 -user = airtime_tests -password = airtime_tests -vhost = /airtime_tests - -[general] -dev_env = testing -api_key = H2NRICX6CM8F50CU123C -web_server_user = www-data -airtime_dir = /usr/share/airtime -base_url = localhost -base_port = 80 -base_dir = / -cache_ahead_hours = 1 -station_id = teststation - -[monit] -monit_user = guest -monit_password = airtime - -[soundcloud] -connection_retries = 3 -time_between_retries = 60 -soundcloud_client_id = 0 -soundcloud_client_secret = 0 -soundcloud_redirect_uri = http://soundcloud.example.org/redirect diff --git a/airtime_mvc/tests/log/.keep b/airtime_mvc/tests/log/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/airtime_mvc/tests/phpunit.xml b/airtime_mvc/tests/phpunit.xml deleted file mode 100644 index cc154d7a0..000000000 --- a/airtime_mvc/tests/phpunit.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - ./ - - - - - ../application/ - - ../application/ - ../application/Bootstrap.php - ../application/controllers/ErrorController.php - - - - - - - - - - - - - diff --git a/airtime_mvc/tests/runtests.sh b/airtime_mvc/tests/runtests.sh deleted file mode 100755 index 61283842d..000000000 --- a/airtime_mvc/tests/runtests.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -#Create a RabbitMQ airtime_tests user -#This is necessary for tests to run - -rabbitmqctl start_app - -RABBITMQ_VHOST="/airtime_tests" -RABBITMQ_USER="airtime_tests" -RABBITMQ_PASSWORD="airtime_tests" -EXCHANGES="airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor" - -rabbitmqctl list_vhosts | grep $RABBITMQ_VHOST -RESULT="$?" - -if [ $RESULT = "0" ]; then - rabbitmqctl delete_vhost $RABBITMQ_VHOST - rabbitmqctl delete_user $RABBITMQ_USER -fi - -rabbitmqctl add_vhost $RABBITMQ_VHOST -rabbitmqctl add_user $RABBITMQ_USER $RABBITMQ_PASSWORD -rabbitmqctl set_permissions -p $RABBITMQ_VHOST $RABBITMQ_USER "$EXCHANGES" "$EXCHANGES" "$EXCHANGES" - -export RABBITMQ_USER -export RABBITMQ_PASSWORD -export RABBITMQ_VHOST - -export AIRTIME_UNIT_TEST="1" - -#Change the working directory to this script's directory -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $DIR - -#Run the unit tests -phpunit --verbose --log-junit test_results.xml - diff --git a/tests/README b/tests/README deleted file mode 100644 index 60dff673d..000000000 --- a/tests/README +++ /dev/null @@ -1,13 +0,0 @@ -Airtime Tests - -Selenium: -- No prerequisites required. -- To set it up and run it, run: - $ ./run_selenium.sh - - -Airtime web app unit tests: -- See airtime_mvc/tests/README - -Airtime Analyzer unit tests -- See python_app/airtime_analyzer/README diff --git a/tests/run_selenium.sh b/tests/run_selenium.sh deleted file mode 100755 index 7647eddde..000000000 --- a/tests/run_selenium.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -SELENIUM_BIN=selenium-server-standalone-2.42.2.jar -SELENIUM_URL=http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar - -printUsage() -{ - echo "Usage: ${0} airtime_url" - echo " Example: ${0} http://bananas.airtime.pro" -} -if [ -z "$1" ] -then - printUsage - exit 1 -fi - -AIRTIME_URL="${1}" - -# Check if java is installed -which java >& /dev/null -if [ $? -gt 0 ] -then - echo "java not found. Please install it." -fi - -# Check for selenium-server -if [ ! -f ${SELENIUM_BIN} ] -then - echo "Selenium not found, downloading it..." - wget ${SELENIUM_URL} -fi - -# Check for xvfb-run, which lets us run Firefox in a headless X server -which xvfb-run >& /dev/null -if [ $? -gt 0 ] -then - echo "xvfb-run not found, apt-getting it now..." - sudo apt-get install xvfb -fi - -# Livechat is very slow to load sometimes, which can make the tests fail. Here we tell Selenium to replace "livechatinc" in any HTML with -# some non-existent domain. -REMOVE_LIVECHAT_PARAMS="-userContentTransformation livechatinc foobar1234567testtest" - -# You must pass the full path to the HTML suite and the results file to Selenium: -xvfb-run java -jar ${SELENIUM_BIN} -proxyInjectionMode ${REMOVE_LIVECHAT_PARAMS} -htmlSuite "*firefox" "${AIRTIME_URL}" "${PWD}"/selenium/Airtime.html "${PWD}"/results.html - diff --git a/tests/selenium/Add Media Skeleton Present.html b/tests/selenium/Add Media Skeleton Present.html deleted file mode 100644 index d9def30cf..000000000 --- a/tests/selenium/Add Media Skeleton Present.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -Add Media Skeleton Present - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add Media Skeleton Present
open/Showbuilder
clickAndWait//ul[@id='nav']/li[2]/a/span
verifyElementPresentid=recent_uploads
verifyElementPresentid=plupload_files_container
- - diff --git a/tests/selenium/Airtime.html b/tests/selenium/Airtime.html deleted file mode 100644 index c15631cb4..000000000 --- a/tests/selenium/Airtime.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - Test Suite - - - - - - - - - - - - - -
Test Suite
Login and Logout
Login
Add Media Skeleton Present
Library Skeleton Present
Calendar Skeleton Present
System Menu Contents
Calendar Add Show Skeleton
Calendar Day Week Month Views
Preferences Skeletons
- - diff --git a/tests/selenium/Calendar Add Show Skeleton.html b/tests/selenium/Calendar Add Show Skeleton.html deleted file mode 100644 index c369c304b..000000000 --- a/tests/selenium/Calendar Add Show Skeleton.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - -Calendar Add Show Skeleton - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Calendar Add Show Skeleton
open/Library
clickAndWaitlink=Calendar
waitForTablecss=table.fc-header.0.0todayShow
clicklink=Show
click//div[@id='schedule-add-show']/h3[2]
click//div[@id='schedule-add-show']/h3[3]
click//div[@id='schedule-add-show']/h3[4]
click//div[@id='schedule-add-show']/h3[5]
verifyElementPresentid=schedule-add-show
verifyElementPresent//div[@id='schedule-add-show']/div/button
verifyElementPresentid=add_show_name
verifyElementPresentid=add_show_url
verifyElementPresentid=add_show_genre
verifyElementPresentid=add_show_description
verifyElementPresentid=add_show_start_date
clickid=add_show_start_date-label
clickid=add_show_duration-label
verifyElementPresentid=add_show_duration
verifyElementPresentid=add_show_timezone
verifyValueid=add_show_repeatsoff
verifyElementPresentid=add_show_repeats
verifyElementPresentid=add_show_hosts_autocomplete
verifyElementPresentid=cb_airtime_auth
verifyElementPresentid=cb_custom_auth
verifyElementPresentid=add_show_background_color
verifyElementPresentid=add_show_color
- - diff --git a/tests/selenium/Calendar Day Week Month Views.html b/tests/selenium/Calendar Day Week Month Views.html deleted file mode 100644 index 6cefa5625..000000000 --- a/tests/selenium/Calendar Day Week Month Views.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - -Calendar Day Week Month Views - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Calendar Day Week Month Views
open/Schedule
clickAndWaitcss=li.top.active > a.top_link > span
click//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span/span/span
verifyElementPresentcss=select.schedule_change_slots.input_select
selectWindownull
waitForTablecss=table.fc-header.0.2dayweekmonth
click//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span[3]/span/span
verifyElementPresent//div[@id='schedule_calendar']/div/div/table/thead/tr/th[4]
verifyElementPresent//div[@id='schedule_calendar']
click//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span[5]/span/span
verifyElementPresent//div[@id='schedule_calendar']/div/div/table/thead/tr/th
- - diff --git a/tests/selenium/Calendar Skeleton Present.html b/tests/selenium/Calendar Skeleton Present.html deleted file mode 100644 index 994200394..000000000 --- a/tests/selenium/Calendar Skeleton Present.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - -Calendar Skeleton Present - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Calendar Skeleton Present
open/Library
selectWindownull
clickAndWaitlink=Calendar
waitForTableid=schedule_block_table.0.1todayShowNovember 2014dayweekmonthSunMonTueWedThuFriSat26



27



28



29



30



31



1



2



3



4



5



6



7



8



9



10



11



12



13



14



15



16



17



18



19



20



21



22



23



24



25



26



27



28



29



30



1



2



3



4



5



6



11:00 - 15:00Weekend Morning Blues

11:00 - 12:00naregggg

11:00 - 18:00TestNareg

11:00 - 18:00TestNareg

11:50 - 12:55nareg51

11:00 - 18:00TestNareg

11:00 - 16:00Weekend Morning Blues

13:45 - 16:55nareg55

13:45 - 14:57nareg55

15:00 - 15:07nareg88

11:00 - 16:00Weekend Morning Blues

11:00 - 16:00Weekend Morning Blues

12:10 - 14:30nareg4

15:00 - 19:00nareg5

11:00 - 16:00Weekend Morning Blues

11:00 - 16:00Weekend Morning Blues

12:10 - 14:30nareg4

15:00 - 19:00nareg5

11:00 - 16:00Weekend Morning Blues

11:00 - 16:00Weekend Morning Blues
   

12:10 - 14:30nareg4

22:01 - 23:00Untitled Show

23:00 - 0:00Untitled Show
   

15:00 - 19:00nareg5

11:00 - 16:00Weekend Morning Blues
   

11:00 - 16:00Weekend Morning Blues
   

12:10 - 14:30nareg4
   

15:00 - 19:00nareg5
   

11:00 - 16:00Weekend Morning Blues
   

11:00 - 16:00Weekend Morning Blues
   

12:10 - 14:30nareg4
   

15:00 - 19:00nareg5
verifyElementPresentid=schedule_calendar
waitForTablecss=table.fc-header.0.2dayweekmonth
verifyElementPresent//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span[3]/span/span
verifyElementPresent//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span[5]/span/span
verifyElementPresentlink=Show
verifyElementPresent//div[@id='schedule_calendar']/table/tbody/tr/td[3]/span/span/span
- - diff --git a/tests/selenium/Library Skeleton Present.html b/tests/selenium/Library Skeleton Present.html deleted file mode 100644 index a6f01315b..000000000 --- a/tests/selenium/Library Skeleton Present.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -Library Skeleton Present - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Library Skeleton Present
open/Plupload
clickAndWait//ul[@id='nav']/li[3]/a/span
verifyElementPresentid=library_content
verifyElementPresentid=side_playlist
- - diff --git a/tests/selenium/Login and Logout.html b/tests/selenium/Login and Logout.html deleted file mode 100644 index 23a742959..000000000 --- a/tests/selenium/Login and Logout.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - -Login and Logout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Login and Logout
open/login/logout
open/login
typeid=usernametest
typeid=passwordtest
clickAndWaitid=submit
verifyElementPresentcss=a.listen-control-button > span
clickAndWaitlink=Logout
verifyElementPresentid=submit
- - diff --git a/tests/selenium/Login.html b/tests/selenium/Login.html deleted file mode 100644 index 5e25b5a6b..000000000 --- a/tests/selenium/Login.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -Login - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Login
open/login
typeid=usernametest
typeid=passwordtest
clickAndWaitid=submit
- - diff --git a/tests/selenium/Preferences Skeletons.html b/tests/selenium/Preferences Skeletons.html deleted file mode 100644 index 47f114551..000000000 --- a/tests/selenium/Preferences Skeletons.html +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - -Preferences Skeletons - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Preferences Skeletons
open/Schedule
clickAndWaitlink=Preferences
verifyElementPresent//div[@id='content']/div
clickAndWaitlink=Users
verifyElementPresent//div[@id='content']/div
clickAndWaitlink=Streams
verifyElementPresent//div[@id='content']/div
verifyElementPresentid=icecast_vorbis_metadata
clickAndWaitlink=Status
verifyElementPresentcss=table.statustable
clickAndWaitlink=Listener Stats
verifyElementPresentid=listenerstat_content
verifyElementPresentcss=span.ui-icon.ui-icon-search
- - diff --git a/tests/selenium/System Menu Contents.html b/tests/selenium/System Menu Contents.html deleted file mode 100644 index a064cabbb..000000000 --- a/tests/selenium/System Menu Contents.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -System Menu Contents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
System Menu Contents
open/Schedule
verifyElementPresentlink=Preferences
verifyElementPresentlink=Users
verifyElementPresentlink=Streams
verifyElementPresentlink=Status
verifyElementPresentlink=Support Feedback
verifyElementPresentlink=Listener Stats
- - From 8a7bd6b952f45ee0006e4f7d34f524d78583f35b Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 19 Nov 2020 14:45:08 -0500 Subject: [PATCH 08/16] Restoring some tests in airtime_mvc --- airtime_mvc/tests/application/bootstrap.php | 83 +++ .../application/helpers/AirtimeInstall.php | 356 +++++++++ .../tests/application/helpers/TestHelper.php | 136 ++++ .../models/database/BlockDbTest.php | 95 +++ .../models/database/ScheduleDbTest.php | 138 ++++ .../models/database/datasets/seed_files.yml | 177 +++++ .../database/datasets/seed_schedule.yml | 11 + .../datasets/test_checkOverlappingShows.yml | 270 +++++++ .../models/unit/PreferenceUnitTest.php | 21 + .../models/unit/ScheduleUnitTest.php | 78 ++ .../services/database/ShowServiceDbTest.php | 698 ++++++++++++++++++ .../database/datasets/seed_show_service.yml | 11 + .../test_ccShowInsertedIntoDatabase.yml | 19 + ...hangeRepeatDayUpdatesScheduleCorrectly.yml | 79 ++ ...test_createBiWeeklyRepeatNoEndNoRRShow.yml | 63 ++ .../datasets/test_createLinkedShow.yml | 90 +++ ...reateMonthlyMonthlyRepeatNoEndNoRRShow.yml | 54 ++ ...createMonthlyWeeklyRepeatNoEndNoRRShow.yml | 54 ++ .../datasets/test_createNoRepeatNoRRShow.yml | 45 ++ .../datasets/test_createNoRepeatRRShow.yml | 185 +++++ ...st_createQuadWeeklyRepeatNoEndNoRRShow.yml | 54 ++ ...est_createTriWeeklyRepeatNoEndNoRRShow.yml | 54 ++ .../test_createWeeklyRepeatNoEndNoRRShow.yml | 90 +++ .../test_createWeeklyRepeatRRShow.yml | 208 ++++++ .../datasets/test_deleteRepeatingShow.yml | 6 + .../datasets/test_deleteShowInstance.yml | 90 +++ ...test_deleteShowInstanceAndAllFollowing.yml | 204 +++++ ...est_editRepeatingShowChangeNoEndOption.yml | 54 ++ .../test_editRepeatingShowInstance.yml | 111 +++ ...tRepeatShowDayUpdatesScheduleCorrectly.yml | 79 ++ ...CreationWhenUserMovesForwardInCalendar.yml | 90 +++ .../datasets/test_unlinkLinkedShow.yml | 90 +++ .../datasets/test_weeklyToBiWeekly.yml | 63 ++ .../datasets/test_weeklyToNoRepeat.yml | 45 ++ .../services/unit/ShowServiceUnitTest.php | 139 ++++ .../application/testdata/BlockModelData.php | 51 ++ .../application/testdata/ShowServiceData.php | 513 +++++++++++++ airtime_mvc/tests/conf/airtime.conf | 51 ++ airtime_mvc/tests/conf/testing/airtime.conf | 35 + airtime_mvc/tests/log/.keep | 0 airtime_mvc/tests/phpunit.xml | 30 + airtime_mvc/tests/runtests.sh | 37 + 42 files changed, 4757 insertions(+) create mode 100644 airtime_mvc/tests/application/bootstrap.php create mode 100644 airtime_mvc/tests/application/helpers/AirtimeInstall.php create mode 100644 airtime_mvc/tests/application/helpers/TestHelper.php create mode 100644 airtime_mvc/tests/application/models/database/BlockDbTest.php create mode 100644 airtime_mvc/tests/application/models/database/ScheduleDbTest.php create mode 100644 airtime_mvc/tests/application/models/database/datasets/seed_files.yml create mode 100644 airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml create mode 100644 airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml create mode 100644 airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php create mode 100644 airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php create mode 100644 airtime_mvc/tests/application/services/database/ShowServiceDbTest.php create mode 100644 airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml create mode 100644 airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml create mode 100644 airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php create mode 100644 airtime_mvc/tests/application/testdata/BlockModelData.php create mode 100644 airtime_mvc/tests/application/testdata/ShowServiceData.php create mode 100644 airtime_mvc/tests/conf/airtime.conf create mode 100644 airtime_mvc/tests/conf/testing/airtime.conf create mode 100644 airtime_mvc/tests/log/.keep create mode 100644 airtime_mvc/tests/phpunit.xml create mode 100755 airtime_mvc/tests/runtests.sh diff --git a/airtime_mvc/tests/application/bootstrap.php b/airtime_mvc/tests/application/bootstrap.php new file mode 100644 index 000000000..857399f1e --- /dev/null +++ b/airtime_mvc/tests/application/bootstrap.php @@ -0,0 +1,83 @@ +query($sql)->fetchColumn(0); + } catch (PDOException $e){ + // no pref table therefore Airtime is not installed. + //We only get here if airtime database exists, but the table doesn't + //This state sometimes happens if a previous Airtime uninstall couldn't remove + //the database because it was busy, so it just removed the tables instead. + return null; + } + //if version is empty string, then version is older than version 1.8.0 + if ($version == '') { + try { + // If this table exists, then it's version 1.7.0 + $sql = "SELECT * FROM cc_show_rebroadcast LIMIT 1"; + $result = $con->query($sql)->fetchColumn(0); + $version = "1.7.0"; + } catch (Exception $e) { + $version = null; + } + } + return $version; + } + public static function DbTableExists($p_name) + { + $con = Propel::getConnection(); + try { + $sql = "SELECT * FROM ".$p_name." LIMIT 1"; + $con->query($sql); + } catch (PDOException $e){ + return false; + } + return true; + } + public static function InstallQuery($sql, $verbose = true) + { + $con = Propel::getConnection(); + try { + $con->exec($sql); + if ($verbose) { + echo "done.\n"; + } + } catch (Exception $e) { + echo "Error!\n".$e->getMessage()."\n"; + echo " SQL statement was:\n"; + echo " ".$sql."\n\n"; + } + } + public static function DropSequence($p_sequenceName) + { + AirtimeInstall::InstallQuery("DROP SEQUENCE IF EXISTS $p_sequenceName", false); + } + + + /** + * Try to connect to the database. Return true on success, false on failure. + * @param boolean $p_exitOnError + * Exit the program on failure. + * @return boolean + */ + public static function DbConnect($p_exitOnError = true) + { + $CC_CONFIG = Config::getConfig(); + try { + $con = Propel::getConnection(); + } catch (Exception $e) { + echo $e->getMessage().PHP_EOL; + echo "Database connection problem.".PHP_EOL; + echo "Check if database '{$CC_CONFIG['dsn']['database']}' exists". + " with corresponding permissions.".PHP_EOL; + if ($p_exitOnError) { + exit(1); + } + return false; + } + return true; + } + /* TODO: This function should be moved to the media-monitor + * install script. */ + public static function InstallStorageDirectory() + { + $CC_CONFIG = Config::getConfig(); + echo "* Storage directory setup".PHP_EOL; + $ini = parse_ini_file(__DIR__."/airtime-install.ini"); + $stor_dir = $ini["storage_dir"]; + $dirs = array($stor_dir, $stor_dir."/organize"); + foreach ($dirs as $dir){ + if (!file_exists($dir)) { + if (mkdir($dir, 02775, true)){ + $rp = realpath($dir); + echo "* Directory $rp created".PHP_EOL; + } else { + echo "* Failed creating {$dir}".PHP_EOL; + exit(1); + } + } + else if (is_writable($dir)) { + $rp = realpath($dir); + echo "* Skipping directory already exists: $rp".PHP_EOL; + } + else { + $rp = realpath($dir); + echo "* Error: Directory already exists, but is not writable: $rp".PHP_EOL; + exit(1); + } + echo "* Giving Apache permission to access $rp".PHP_EOL; + $success = chown($rp, $CC_CONFIG["webServerUser"]); + $success = chgrp($rp, $CC_CONFIG["webServerUser"]); + $success = chmod($rp, 0775); + } + } + public static function CreateDatabaseUser() + { + $CC_CONFIG = Config::getConfig(); + echo " * Creating Airtime database user".PHP_EOL; + $username = $CC_CONFIG['dsn']['username']; + $password = $CC_CONFIG['dsn']['password']; + $command = "echo \"CREATE USER $username ENCRYPTED PASSWORD '$password' LOGIN CREATEDB NOCREATEUSER;\" | su postgres -c psql 2>/dev/null"; + @exec($command, $output, $results); + if ($results == 0) { + echo " * Database user '{$CC_CONFIG['dsn']['username']}' created.".PHP_EOL; + } else { + if (count($output) > 0) { + echo " * Could not create user '{$CC_CONFIG['dsn']['username']}': ".PHP_EOL; + echo implode(PHP_EOL, $output); + } + else { + echo " * Database user '{$CC_CONFIG['dsn']['username']}' already exists.".PHP_EOL; + } + } + } + public static function CreateDatabase() + { + $CC_CONFIG = Config::getConfig(); + $database = $CC_CONFIG['dsn']['database']; + $username = $CC_CONFIG['dsn']['username']; + $password = $CC_CONFIG['dsn']['password']; + $hostspec = $CC_CONFIG['dsn']['hostspec']; + + echo " * Creating Airtime database: " . $database . PHP_EOL; + + $dbExists = false; + try { + $con = pg_connect('user='.$username.' password='.$password.' host='.$hostspec); + + pg_query($con, 'CREATE DATABASE '.$database.' WITH ENCODING \'UTF8\' TEMPLATE template0 OWNER '.$username.';'); + + } catch (Exception $e) { + // rethrow if not a "database already exists" error + if ($e->getCode() != 2 && strpos($e->getMessage(), 'already exists') !== false) throw $e; + echo " * Database already exists." . PHP_EOL; + $dbExists = true; + } + + if (!$dbExists) { + echo " * Database $database created.".PHP_EOL; + } + return $dbExists; + } + public static function InstallPostgresScriptingLanguage() + { + $con = Propel::getConnection(); + // Install postgres scripting language + $sql = 'SELECT COUNT(*) FROM pg_language WHERE lanname = \'plpgsql\''; + $langIsInstalled = $con->query($sql)->fetchColumn(0); + if ($langIsInstalled == '0') { + echo " * Installing Postgres scripting language".PHP_EOL; + $sql = "CREATE LANGUAGE 'plpgsql'"; + AirtimeInstall::InstallQuery($sql, false); + } else { + echo " * Postgres scripting language already installed".PHP_EOL; + } + } + public static function CreateDatabaseTables($p_dbuser, $p_dbpasswd, $p_dbname, $p_dbhost) + { + echo " * Creating database tables".PHP_EOL; + // Put Propel sql files in Database + //$command = AirtimeInstall::CONF_DIR_WWW."/library/propel/generator/bin/propel-gen ".AirtimeInstall::CONF_DIR_WWW."/build/ insert-sql 2>/dev/null"; + $dir = self::GetAirtimeSrcDir()."/build/sql/"; + $files = array("schema.sql", "sequences.sql", "views.sql", "triggers.sql", "defaultdata.sql"); + foreach ($files as $f){ + $command = "export PGPASSWORD=$p_dbpasswd && psql --username $p_dbuser --dbname $p_dbname --host $p_dbhost --file $dir$f 2>&1"; + @exec($command, $output, $results); + } + AirtimeInstall::$databaseTablesCreated = true; + } + public final static function UpdateDatabaseTables() { + UpgradeManager::doUpgrade(); + } + public static function SetAirtimeVersion($p_version) + { + $con = Propel::getConnection(); + $sql = "DELETE FROM cc_pref WHERE keystr = 'system_version'"; + $con->exec($sql); + Application_Model_Preference::SetAirtimeVersion($p_version); + } + public static function SetUniqueId() + { + $uniqueId = md5(uniqid("", true)); + Application_Model_Preference::SetUniqueId($uniqueId); + } + public static function GetAirtimeVersion() + { + $config = Config::getConfig(); + return $config['airtime_version']; + } + public static function DeleteFilesRecursive($p_path) + { + $command = "rm -rf \"$p_path\""; + exec($command); + } + public static function InstallPhpCode() + { + $CC_CONFIG = Config::getConfig(); + echo "* Installing PHP code to ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL; + exec("mkdir -p ".AirtimeInstall::CONF_DIR_WWW); + exec("cp -R ".AirtimeInstall::GetAirtimeSrcDir()."/* ".AirtimeInstall::CONF_DIR_WWW); + } + public static function UninstallPhpCode() + { + echo "* Removing PHP code from ".AirtimeInstall::CONF_DIR_WWW.PHP_EOL; + exec('rm -rf "'.AirtimeInstall::CONF_DIR_WWW.'"'); + } + public static function DirCheck() + { + echo "Legend: \"+\" means the dir/file exists, \"-\" means that it does not.".PHP_EOL; + $dirs = array(AirtimeInstall::CONF_DIR_BINARIES, + AirtimeInstall::CONF_DIR_WWW, + AirtimeIni::CONF_FILE_AIRTIME, + AirtimeIni::CONF_FILE_LIQUIDSOAP, + AirtimeIni::CONF_FILE_PYPO, + AirtimeIni::CONF_FILE_RECORDER, + "/usr/lib/airtime/pypo", + "/var/log/airtime", + "/var/log/airtime/pypo", + "/var/tmp/airtime/pypo"); + foreach ($dirs as $f) { + if (file_exists($f)) { + echo "+ $f".PHP_EOL; + } else { + echo "- $f".PHP_EOL; + } + } + } + public static function CreateZendPhpLogFile(){ + $CC_CONFIG = Config::getConfig(); + $path = AirtimeInstall::CONF_DIR_LOG; + $file = $path.'/zendphp.log'; + if (!file_exists($path)){ + mkdir($path, 0755, true); + } + touch($file); + chmod($file, 0644); + chown($file, $CC_CONFIG['webServerUser']); + chgrp($file, $CC_CONFIG['webServerUser']); + } + public static function RemoveLogDirectories(){ + $path = AirtimeInstall::CONF_DIR_LOG; + echo "* Removing logs directory ".$path.PHP_EOL; + exec("rm -rf \"$path\""); + } + public static function removeVirtualEnvDistributeFile(){ + echo "* Removing distribute-0.6.10.tar.gz".PHP_EOL; + if(file_exists('/usr/share/python-virtualenv/distribute-0.6.10.tar.gz')){ + exec("rm -f /usr/share/python-virtualenv/distribute-0.6.10.tar.gz"); + } + } + public static function printUsage($opts) + { + $msg = $opts->getUsageMessage(); + echo PHP_EOL."Usage: airtime-install [options]"; + echo substr($msg, strpos($msg, "\n")).PHP_EOL; + } + public static function getOpts() + { + try { + $autoloader = Zend_Loader_Autoloader::getInstance(); + $opts = new Zend_Console_Getopt( + array( + 'help|h' => 'Displays usage information.', + 'overwrite|o' => 'Overwrite any existing config files.', + 'preserve|p' => 'Keep any existing config files.', + 'no-db|n' => 'Turn off database install.', + 'reinstall|r' => 'Force a fresh install of this Airtime Version', + 'webonly|w' => 'Install only web files' + ) + ); + $opts->parse(); + } catch (Zend_Console_Getopt_Exception $e) { + print $e->getMessage() .PHP_EOL; + AirtimeInstall::printUsage($opts); + return NULL; + } + return $opts; + } + public static function checkPHPVersion() + { + if (PHP_VERSION_ID < 50300) + { + echo "Error: Airtime requires PHP 5.3 or greater."; + return false; + } + return true; + } +} diff --git a/airtime_mvc/tests/application/helpers/TestHelper.php b/airtime_mvc/tests/application/helpers/TestHelper.php new file mode 100644 index 000000000..e2953328a --- /dev/null +++ b/airtime_mvc/tests/application/helpers/TestHelper.php @@ -0,0 +1,136 @@ +setIdentity('admin') + ->setCredential('admin'); + + $auth = Zend_Auth::getInstance(); + $result = $auth->authenticate($authAdapter); + if ($result->isValid()) { + //all info about this user from the login table omit only the password + $userInfo = $authAdapter->getResultRowObject(null, 'password'); + + //the default storage is a session with namespace Zend_Auth + $authStorage = $auth->getStorage(); + $authStorage->write($userInfo); + } + } + + public static function getDbZendConfig() + { + $config = Config::getConfig(); + return new Zend_Config( + array( + 'host' => $config['dsn']['hostspec'], + 'dbname' => $config['dsn']['database'], + 'username' => $config['dsn']['username'], + 'password' => $config['dsn']['password'] + ) + ); + } + + public static function installTestDatabase() + { + //We need to load the config before our app bootstrap runs. The config + //is normally + $CC_CONFIG = Config::getConfig(); + + $dbuser = $CC_CONFIG['dsn']['username']; + $dbpasswd = $CC_CONFIG['dsn']['password']; + $dbname = $CC_CONFIG['dsn']['database']; + $dbhost = $CC_CONFIG['dsn']['hostspec']; + + $databaseAlreadyExists = AirtimeInstall::createDatabase(); + if ($databaseAlreadyExists) + { + //Truncate all the tables + $con = Propel::getConnection(); + $sql = "select * from pg_tables where tableowner = '${dbuser}'"; + try { + $rows = $con->query($sql)->fetchAll(); + } catch (Exception $e) { + $rows = array(); + } + + //Add any tables that shouldn't be cleared here. + // cc_subjs - Most of Airtime requires an admin account to work, which has id=1, + // so don't clear it. + // cc_music_dirs - Has foreign key constraints against cc_files, so we clear cc_files + // first and clear cc_music_dirs after + $tablesToNotClear = array("cc_subjs", "cc_music_dirs"); + + $con->beginTransaction(); + foreach ($rows as $row) { + $tablename = $row["tablename"]; + if (in_array($tablename, $tablesToNotClear)) + { + continue; + } + //echo " * Clearing database table $tablename..."; + + //TRUNCATE is actually slower than DELETE in many cases: + //http://stackoverflow.com/questions/11419536/postgresql-truncation-speed + //$sql = "TRUNCATE TABLE $tablename CASCADE"; + $sql = "DELETE FROM $tablename"; + AirtimeInstall::InstallQuery($sql, false); + } + + //Now that cc_files is empty, clearing cc_music_dirs should work + $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), + //we have to reset the sequences so the auto-increment columns (like primary keys) + //all start at 1 again. This is hacky but it still lets all of this execute fast. + $sql = "SELECT c.relname FROM pg_class c WHERE c.relkind = 'S'"; + try { + $rows = $con->query($sql)->fetchAll(); + } catch (Exception $e) { + $rows = array(); + } + $con->beginTransaction(); + foreach ($rows as $row) { + $seqrelname= $row["relname"]; + $sql = "ALTER SEQUENCE ${seqrelname} RESTART WITH 1"; + AirtimeInstall::InstallQuery($sql, false); + } + $con->commit(); + } + else + { + //Create all the database tables + AirtimeInstall::CreateDatabaseTables($dbuser, $dbpasswd, $dbname, $dbhost); + AirtimeInstall::UpdateDatabaseTables(); + } + } + + public static function setupZendBootstrap() + { + $application = new Zend_Application(APPLICATION_ENV, CONFIG_PATH . 'application.ini'); + $application->bootstrap(); + return $application; + } +} diff --git a/airtime_mvc/tests/application/models/database/BlockDbTest.php b/airtime_mvc/tests/application/models/database/BlockDbTest.php new file mode 100644 index 000000000..1df24c40d --- /dev/null +++ b/airtime_mvc/tests/application/models/database/BlockDbTest.php @@ -0,0 +1,95 @@ +_connectionMock == null) { + $config = TestHelper::getDbZendConfig(); + + $connection = Zend_Db::factory('pdo_pgsql', $config); + + $this->_connectionMock = $this->createZendDbConnection( + $connection, + 'airtimeunittests' + ); + Zend_Db_Table_Abstract::setDefaultAdapter($connection); + } + return $this->_connectionMock; + } + + + /** + * Load a dataset into the database for the block database tests + * + * Defines how the initial state of the database should look before each test is executed + * Called once during setUp() and gets recreated for each new test + */ + public function getDataSet() + { + $dataset = new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/seed_files.yml' ); + return $dataset; + } + + + /** + * Test if the single newest file is added to the Database + * + */ + + public function testGetListofFilesMeetCriteriaSingleMatch() { + TestHelper::loginUser(); + $CC_CONFIG = Config::getConfig(); + $testqry = CcFilesQuery::create(); + $testout = $testqry->find(); + $vd = $testout->getData(); + $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( + $this->getConnection() + ); + $testCriteria = BlockModelData::getCriteriaSingleNewestLabelNada(); + $bltest = new Application_Model_Block(); + $bltest->saveSmartBlockCriteria($testCriteria); + $tracks = $bltest->getListOfFilesUnderLimit(); + //$tracks = $bltest->getLength(); + $this->assertNotEmpty($tracks); + // need to load a example criteria into the database + } + + + /** + * Test if the single newest file is added to the Database + * + */ + + public function testMultiTrackandAlbumsGetLoaded() { + TestHelper::loginUser(); + $CC_CONFIG = Config::getConfig(); + $testqry = CcFilesQuery::create(); + $testout = $testqry->find(); + $vd = $testout->getData(); + $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( + $this->getConnection() + ); + $testCriteria = BlockModelData::getCriteriaMultiTrackAndAlbum1Hour(); + $bltest = new Application_Model_Block(); + $bltest->saveSmartBlockCriteria($testCriteria); + $tracks = $bltest->getListOfFilesUnderLimit(); + //$tracks = $bltest->getLength(); + $this->assertNotEmpty($tracks); + // add assertion that the length is less than 1 hour... + // need to load a example criteria into the database + } + +} \ No newline at end of file diff --git a/airtime_mvc/tests/application/models/database/ScheduleDbTest.php b/airtime_mvc/tests/application/models/database/ScheduleDbTest.php new file mode 100644 index 000000000..cb8ab4a4c --- /dev/null +++ b/airtime_mvc/tests/application/models/database/ScheduleDbTest.php @@ -0,0 +1,138 @@ +appBootstrap(); + + parent::setUp(); + } + + public function appBootstrap() + { + $this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH .'/configs/application.ini'); + $this->application->bootstrap(); + } + + public function getConnection() + { + if ($this->_connectionMock == null) { + $config = TestHelper::getDbZendConfig(); + + $connection = Zend_Db::factory('pdo_pgsql', $config); + + $this->_connectionMock = $this->createZendDbConnection( + $connection, + 'airtimeunittests' + ); + Zend_Db_Table_Abstract::setDefaultAdapter($connection); + } + return $this->_connectionMock; + } + + /* Defines how the initial state of the database should look before each test is executed + * Called once during setUp() and gets recreated for each new test + */ + public function getDataSet() + { + return new PHPUnit_Extensions_Database_DataSet_YamlDataSet( + __DIR__ . '/datasets/seed_schedule.yml' + ); + } + + public function testCheckOverlappingShows() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getOverlappingShowCheckTestData(); + $showService = new Application_Service_ShowService(null, $data); + + /** Create shows to test against **/ + $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 order by id'); + $ds->addTable('cc_show_instances', 'select id, starts, ends, show_id, modified_instance from cc_show_instances order by id'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + /** Make sure shows were created correctly **/ + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_checkOverlappingShows.yml"), + $ds + ); + + $utcTimezone = new DateTimeZone("UTC"); + + /** Test that overlapping check works when creating a new show **/ + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-02-01 00:00:00", $utcTimezone), + new DateTime("2014-02-01 01:00:00", $utcTimezone) + ); + $this->assertEquals($overlapping, false); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-05 00:00:00", $utcTimezone), + new DateTime("2014-01-05 02:00:00", $utcTimezone) + ); + $this->assertEquals($overlapping, true); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-05 01:00:00", $utcTimezone), + new DateTime("2014-01-05 02:00:00", $utcTimezone) + ); + $this->assertEquals($overlapping, false); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-31 00:30:00", $utcTimezone), + new DateTime("2014-01-31 01:30:00", $utcTimezone) + ); + $this->assertEquals($overlapping, true); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-20 23:55:00", $utcTimezone), + new DateTime("2014-01-21 00:00:05", $utcTimezone) + ); + $this->assertEquals($overlapping, true); + + /** Test overlapping check works when editing an entire show **/ + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-05 00:00:00", $utcTimezone), + new DateTime("2014-01-05 02:00:00", $utcTimezone), + true, + null, + 1 + ); + $this->assertEquals($overlapping, false); + + /** Delete a repeating instance, create a new show in it's place and + * test if we can modify the repeating show after **/ + $ccShowInstance = CcShowInstancesQuery::create()->findPk(1); + $ccShowInstance->setDbModifiedInstance(true)->save(); + + $newShowData = ShowServiceData::getNoRepeatNoRRData(); + $newShowData["add_show_start_date"] = "2014-01-05"; + $newShowData["add_show_end_date_no_repeat"] = "2014-01-05"; + $newShowData["add_show_end_date"] = "2014-01-05"; + + $showService->addUpdateShow($newShowData); + + $overlapping = Application_Model_Schedule::checkOverlappingShows( + new DateTime("2014-01-06 00:00:00", $utcTimezone), + new DateTime("2014-01-06 00:30:00", $utcTimezone), + true, + null, + 1 + ); + $this->assertEquals($overlapping, false); + } +} \ No newline at end of file diff --git a/airtime_mvc/tests/application/models/database/datasets/seed_files.yml b/airtime_mvc/tests/application/models/database/datasets/seed_files.yml new file mode 100644 index 000000000..c29094a97 --- /dev/null +++ b/airtime_mvc/tests/application/models/database/datasets/seed_files.yml @@ -0,0 +1,177 @@ + +cc_music_dirs: + - + id: '1' + directory: '/tmp/libretime-test' + type: 'stor' + exists: 't' + watched: 't' + + +cc_files: + - + id: '1' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/oneminute.mp3' + mtime: '2017-08-06 04:27:36' + utime: '2017-08-06 04:26:47' + track_title: 'oneminute.mp3' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:00' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '2586748' + + - + id: '2' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/fiveminute.mp3' + mtime: '2017-08-06 04:28:36' + utime: '2017-08-06 04:27:47' + track_title: 'fiveminute.mp3' + bit_rate: '320000' + sample_rate: '44100' + length: '00:05:00' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + + - + id: '3' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/track1.mp3' + mtime: '2017-08-06 04:28:36' + utime: '2017-08-06 04:27:47' + track_title: 'track1' + album_title: 'album1' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:30' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + + + id: '4' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/track2.mp3' + mtime: '2017-08-06 04:28:36' + utime: '2017-08-06 04:27:47' + track_title: 'track2' + album_title: 'album1' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:30' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + + id: '5' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/track3.mp3' + mtime: '2017-08-06 04:28:36' + utime: '2017-08-06 04:27:47' + track_title: 'track3' + album_title: 'album1' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:30' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + + + + id: '6' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/track1-2.mp3' + mtime: '2017-08-06 05:28:36' + utime: '2017-08-16 04:27:47' + track_title: 'track1' + album_title: 'album2' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:30' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + + + id: '7' + mime: 'audio/mp3' + ftype: 'audioclip' + directory: '1' + filepath: 'imported/1/track2-2.mp3' + mtime: '2017-08-06 04:28:36' + utime: '2017-08-06 04:27:47' + track_title: 'track2' + album_title: 'album2' + bit_rate: '320000' + sample_rate: '44100' + length: '00:01:30' + channels: '2' + genre: 'test' + label: 'nada' + owner_id: '1' + file_exists: 't' + hidden: 'f' + silan_check: 'f' + is_scheduled: 'f' + is_playlist: 'f' + filesize: '5126748' + diff --git a/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml b/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml new file mode 100644 index 000000000..940d2b9f4 --- /dev/null +++ b/airtime_mvc/tests/application/models/database/datasets/seed_schedule.yml @@ -0,0 +1,11 @@ +cc_pref: + - + id: '1' + subjid: null + keystr: shows_populated_until + valstr: '2014-02-01 00:00:00' + - + id: '2' + subjid: null + keystr: timezone + valstr: UTC diff --git a/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml b/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml new file mode 100644 index 000000000..1262edf21 --- /dev/null +++ b/airtime_mvc/tests/application/models/database/datasets/test_checkOverlappingShows.yml @@ -0,0 +1,270 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2014-01-05' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '0' + repeat_type: '0' + next_pop_date: '2014-02-02' + show_id: '1' + record: '0' + - + id: '2' + first_show: '2014-01-06' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '1' + repeat_type: '0' + next_pop_date: '2014-02-03' + show_id: '1' + record: '0' + - + id: '3' + first_show: '2014-01-07' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '2' + repeat_type: '0' + next_pop_date: '2014-02-04' + show_id: '1' + record: '0' + - + id: '4' + first_show: '2014-01-08' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '3' + repeat_type: '0' + next_pop_date: '2014-02-05' + show_id: '1' + record: '0' + - + id: '5' + first_show: '2014-01-09' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '4' + repeat_type: '0' + next_pop_date: '2014-02-06' + show_id: '1' + record: '0' + - + id: '6' + first_show: '2014-01-10' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2014-02-07' + show_id: '1' + record: '0' + - + id: '7' + first_show: '2014-01-11' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '6' + repeat_type: '0' + next_pop_date: '2014-02-01' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2014-01-05 00:00:00' + ends: '2014-01-05 01:00:00' + show_id: '1' + modified_instance: false + - + id: '2' + starts: '2014-01-12 00:00:00' + ends: '2014-01-12 01:00:00' + show_id: '1' + modified_instance: false + - + id: '3' + starts: '2014-01-19 00:00:00' + ends: '2014-01-19 01:00:00' + show_id: '1' + modified_instance: false + - + id: '4' + starts: '2014-01-26 00:00:00' + ends: '2014-01-26 01:00:00' + show_id: '1' + modified_instance: false + - + id: '5' + starts: '2014-01-06 00:00:00' + ends: '2014-01-06 01:00:00' + show_id: '1' + modified_instance: false + - + id: '6' + starts: '2014-01-13 00:00:00' + ends: '2014-01-13 01:00:00' + show_id: '1' + modified_instance: false + - + id: '7' + starts: '2014-01-20 00:00:00' + ends: '2014-01-20 01:00:00' + show_id: '1' + modified_instance: false + - + id: '8' + starts: '2014-01-27 00:00:00' + ends: '2014-01-27 01:00:00' + show_id: '1' + modified_instance: false + - + id: '9' + starts: '2014-01-07 00:00:00' + ends: '2014-01-07 01:00:00' + show_id: '1' + modified_instance: false + - + id: '10' + starts: '2014-01-14 00:00:00' + ends: '2014-01-14 01:00:00' + show_id: '1' + modified_instance: false + - + id: '11' + starts: '2014-01-21 00:00:00' + ends: '2014-01-21 01:00:00' + show_id: '1' + modified_instance: false + - + id: '12' + starts: '2014-01-28 00:00:00' + ends: '2014-01-28 01:00:00' + show_id: '1' + modified_instance: false + - + id: '13' + starts: '2014-01-08 00:00:00' + ends: '2014-01-08 01:00:00' + show_id: '1' + modified_instance: false + - + id: '14' + starts: '2014-01-15 00:00:00' + ends: '2014-01-15 01:00:00' + show_id: '1' + modified_instance: false + - + id: '15' + starts: '2014-01-22 00:00:00' + ends: '2014-01-22 01:00:00' + show_id: '1' + modified_instance: false + - + id: '16' + starts: '2014-01-29 00:00:00' + ends: '2014-01-29 01:00:00' + show_id: '1' + modified_instance: false + - + id: '17' + starts: '2014-01-09 00:00:00' + ends: '2014-01-09 01:00:00' + show_id: '1' + modified_instance: false + - + id: '18' + starts: '2014-01-16 00:00:00' + ends: '2014-01-16 01:00:00' + show_id: '1' + modified_instance: false + - + id: '19' + starts: '2014-01-23 00:00:00' + ends: '2014-01-23 01:00:00' + show_id: '1' + modified_instance: false + - + id: '20' + starts: '2014-01-30 00:00:00' + ends: '2014-01-30 01:00:00' + show_id: '1' + modified_instance: false + - + id: '21' + starts: '2014-01-10 00:00:00' + ends: '2014-01-10 01:00:00' + show_id: '1' + modified_instance: false + - + id: '22' + starts: '2014-01-17 00:00:00' + ends: '2014-01-17 01:00:00' + show_id: '1' + modified_instance: false + - + id: '23' + starts: '2014-01-24 00:00:00' + ends: '2014-01-24 01:00:00' + show_id: '1' + modified_instance: false + - + id: '24' + starts: '2014-01-31 00:00:00' + ends: '2014-01-31 01:00:00' + show_id: '1' + modified_instance: false + - + id: '25' + starts: '2014-01-11 00:00:00' + ends: '2014-01-11 01:00:00' + show_id: '1' + modified_instance: false + - + id: '26' + starts: '2014-01-18 00:00:00' + ends: '2014-01-18 01:00:00' + show_id: '1' + modified_instance: false + - + id: '27' + starts: '2014-01-25 00:00:00' + ends: '2014-01-25 01:00:00' + show_id: '1' + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php b/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php new file mode 100644 index 000000000..c27f8453d --- /dev/null +++ b/airtime_mvc/tests/application/models/unit/PreferenceUnitTest.php @@ -0,0 +1,21 @@ +assertEquals(Application_Model_Preference::GetShowsPopulatedUntil(), $date); + } + +} diff --git a/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php new file mode 100644 index 000000000..2c9921bf3 --- /dev/null +++ b/airtime_mvc/tests/application/models/unit/ScheduleUnitTest.php @@ -0,0 +1,78 @@ +add(new DateInterval('P1Y')); //1 year into the future + $futureDateString = $futureDate->format('Y-m-d'); + + $testShowData["add_show_start_date"] = $futureDateString; + $testShowData["add_show_end_date"] = $futureDateString; + $testShowData["add_show_end_date_no_repeat"] = $futureDateString; + + //Fudge the "populated until" date to workaround and issue where the default + //value will prevent anything from actually being scheduled. Normally this isn't + //a problem because as soon as you view the calendar for the first time, this is + //set to a week ahead in the future. + $populateUntil = new DateTime("now", new DateTimeZone('UTC')); + $populateUntil = $populateUntil->add(new DateInterval("P2Y")); //2 years ahead in the future. + Application_Model_Preference::SetShowsPopulatedUntil($populateUntil); + + //$showService->setCcShow($testShowData); //Denise says this is not needed. + $showService->addUpdateShow($testShowData); //Create show instances + + // Moved creation of stor directory to TestHelper for setup + + // Insert a fake file into the database + $request = $this->getRequest(); + $params = $request->getParams(); + $params['action'] = ''; + $params['api_key'] = $CC_CONFIG["apiKey"][0]; + $request->setParams($params); + + $metadata = array("MDATA_KEY_FILEPATH" => "/tmp/foobar.mp3", + "MDATA_KEY_DURATION" => "00:01:00", + "is_record" => false); + + //Create the file in the database via the HTTP API. + $apiController = new ApiController($this->request, $this->getResponse()); + $results = $apiController->dispatchMetadata($metadata, "create"); + $fileId = $results["fileid"]; + $this->assertNotEquals($fileId, -1); + $this->assertEquals($fileId, 1); + + //The file should not be scheduled in the future (or at all) at this point + $scheduleModel = new Application_Model_Schedule(); + $scheduleModel->IsFileScheduledInTheFuture($fileId); + $this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), false); + + //Schedule the fake file in the test show, which should be in the future. + $showInstance = new Application_Model_ShowInstance(1); + $showInstance->addFileToShow($fileId); + + //Test the function we actually want to test. :-) + $this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), true); + } +} + diff --git a/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php b/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php new file mode 100644 index 000000000..cea84434f --- /dev/null +++ b/airtime_mvc/tests/application/services/database/ShowServiceDbTest.php @@ -0,0 +1,698 @@ +_nowDT = new DateTime("now", new DateTimeZone("UTC")); + + parent::setUp(); + } + + public function getConnection() + { + if ($this->_connectionMock == null) { + $config = TestHelper::getDbZendConfig(); + + $connection = Zend_Db::factory('pdo_pgsql', $config); + + $this->_connectionMock = $this->createZendDbConnection( + $connection, + 'airtimeunittests' + ); + Zend_Db_Table_Abstract::setDefaultAdapter($connection); + } + return $this->_connectionMock; + } + + /* Defines how the initial state of the database should look before each test is executed + * Called once during setUp() and gets recreated for each new test + */ + public function getDataSet() + { + return new PHPUnit_Extensions_Database_DataSet_YamlDataSet( + __DIR__ . '/datasets/seed_show_service.yml' + ); + } + + public function testCcShowInsertedIntoDatabase() + { + $showService = new Application_Service_ShowService(); + + $data = array( + "add_show_id" => -1, + "add_show_name" => "test show", + "add_show_description" => null, + "add_show_url" => null, + "add_show_genre" => null, + "add_show_color" => "ffffff", + "add_show_background_color" => "364492", + "cb_airtime_auth" => false, + "cb_custom_auth" => false, + "custom_username" => null, + "custom_password" => null, + "add_show_linked" => false, + "add_show_has_autoplaylist" => 0, + "add_show_autoplaylist_id" => null, + "add_show_autoplaylist_repeat" => 0 + ); + + $showService->setCcShow($data); + + $ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet( + $this->getConnection() + ); + $ds->addTable('cc_show', 'select * from cc_show'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_ccShowInsertedIntoDatabase.yml"), + $ds + ); + } + + /* Tests that a non-repeating, non-record, and non-rebroadcast show + * gets created properly + */ + public function testCreateNoRepeatNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getNoRepeatNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createNoRepeatNoRRShow.yml'), + $ds + ); + } + + /* Tests that a weekly repeating, non-record, non-rebroadcast show + * with no end date gets created correctly + */ + public function testCreateWeeklyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml'), + $ds + ); + } + + public function testCreateBiWeeklyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "1"; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml'), + $ds + ); + } + + public function testCreateTriWeeklyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "4"; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml'), + $ds + ); + } + + public function testCreateQuadWeeklyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "5"; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml"), + $ds + ); + } + + public function testCreateMonthlyMonthlyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "2"; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml"), + $ds + ); + } + + public function testCreateMonthlyWeeklyRepeatNoEndNoRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "3"; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml"), + $ds + ); + } + + /* Tests that a show instance gets deleted from it's repeating sequence properly + */ + public function testDeleteShowInstance() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $service_show = new Application_Service_ShowService(null, $data); + $service_show->addUpdateShow($data); + $service_show->deleteShow(3, true); + + $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'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstance.yml"), + $ds + ); + } + + /* Tests that when a user selects 'Delete this instance and all following + * on the calendar the database gets updated correctly + */ + public function testDeleteShowInstanceAndAllFollowing() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_day_check"] = array(5,1,2); + + $service_show = new Application_Service_ShowService(null, $data); + $service_show->addUpdateShow($data); + //delete some single instances first + $service_show->deleteShow(1, true); + $service_show->deleteShow(6, true); + $service_show->deleteShow(8, true); + //delete all instances including and after where id=4 + $service_show->deleteShow(4); + + $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 order by first_show'); + $ds->addTable('cc_show_instances', 'select id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances order by id'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteShowInstanceAndAllFollowing.yml"), + $ds + ); + } + + public function testEditRepeatingShowInstance() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + + $showService->addUpdateShow($data); + //move the start date forward one week and the start time forward one hour + $editData = ShowServiceData::getEditRepeatInstanceData(); + + //need to create a new service so it gets constructed with the new data + $showService = new Application_Service_ShowService(null, $editData); + $showService->editRepeatingShowInstance($editData); + + $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'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowInstance.yml"), + $ds + ); + } + + /* Tests the entire show gets deleted when the user selects 'Delete this + * instance and all following' from the context menu on the calendar + */ + public function testDeleteRepeatingShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + + $showService->addUpdateShow($data); + $showService->deleteShow(1); + + $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'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_deleteRepeatingShow.yml"), + $ds + ); + } + + public function testRepeatShowCreationWhenUserMovesForwardInCalendar() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_repeat_type"] = "1"; + $showService = new Application_Service_ShowService(null, $data); + + $showService->addUpdateShow($data); + + //simulate the user moves forward in the calendar + $end = new DateTime("2044-03-12", new DateTimeZone("UTC")); + $showService->delegateInstanceCreation(null, $end, true); + + $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'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml"), + $ds + ); + } + + public function testLinkedShow() + { + TestHelper::loginUser(); + + /** Test creating a linked show **/ + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_linked"] = 1; + $showService = new Application_Service_ShowService(null, $data); + + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createLinkedShow.yml"), + $ds + ); + } + + /** Test the creation of a single record and rebroadcast(RR) show **/ + public function testCreateNoRepeatRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getNoRepeatRRData(); + $showService = new Application_Service_ShowService(null, $data); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createNoRepeatRRShow.yml"), + $ds + ); + } + + /** Test the creation of a weekly repeating, record and rebroadcast(RR) show **/ + public function testCreateWeeklyRepeatRRShow() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatRRData(); + $showService = new Application_Service_ShowService(null, $data); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_createWeeklyRepeatRRShow.yml"), + $ds + ); + } + + public function testEditRepeatingShowChangeNoEndOption() + { + TestHelper::loginUser(); + + /** Test changing the no end option on a weekly repeating show **/ + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + $showService->addUpdateShow($data); + + $data["add_show_end_date"] = '2044-01-09'; + $data["add_show_no_end"] = 0; + $data["add_show_id"] = 1; + + $showService = new Application_Service_ShowService(null, $data, true); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_editRepeatingShowChangeNoEndOption.yml"), + $ds + ); + } + + /** + * Tests that when you remove the first repeat show day, which changes + * the show's first instance start date, updates the scheduled content + * correctly + */ + public function testRemoveFirstRepeatShowDayUpdatesScheduleCorrectly() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_start_date"] = "2044-01-29"; + $data["add_show_day_check"] = array(5,6); + $data["add_show_linked"] = 1; + $showService = new Application_Service_ShowService(null, $data); + $showService->addUpdateShow($data); + + //insert some fake tracks into cc_schedule table + $ccFiles = new CcFiles(); + $ccFiles + ->setDbCueIn("00:00:00") + ->setDbCueOut("00:04:32") + ->save(); + + $scheduleItems = array( + 0 => array( + "id" => 0, + "instance" => 1, + "timestamp" => time() + ) + ); + $mediaItems = array( + 0 => array( + "id" => 1, + "type" => "audioclip" + ) + ); + $scheduler = new Application_Model_Scheduler(); + $scheduler->scheduleAfter($scheduleItems, $mediaItems); + + //delete the first repeat day + $data["add_show_day_check"] = array(6); + $data["add_show_id"] = 1; + $showService = new Application_Service_ShowService(null, $data, true); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + $ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml"), + $ds + ); + } + + public function testChangeRepeatDayUpdatesScheduleCorrectly() + { + TestHelper::loginUser(); + + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $data["add_show_start_date"] = "2044-01-29"; + $data["add_show_day_check"] = array(5, 6); + $data["add_show_linked"] = 1; + $showService = new Application_Service_ShowService(null, $data); + $showService->addUpdateShow($data); + + //insert some fake tracks into cc_schedule table + $ccFiles = new CcFiles(); + $ccFiles + ->setDbCueIn("00:00:00") + ->setDbCueOut("00:04:32") + ->save(); + + $scheduleItems = array( + 0 => array( + "id" => 0, + "instance" => 1, + "timestamp" => time() + ) + ); + $mediaItems = array( + 0 => array( + "id" => 1, + "type" => "audioclip" + ) + ); + $scheduler = new Application_Model_Scheduler(); + $scheduler->scheduleAfter($scheduleItems, $mediaItems); + + //delete the first repeat day + $data["add_show_day_check"] = array(6); + $data["add_show_id"] = 1; + $showService = new Application_Service_ShowService(null, $data, true); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance from cc_show_instances'); + $ds->addTable('cc_show_rebroadcast', 'select * from cc_show_rebroadcast'); + $ds->addTable('cc_show_hosts', 'select * from cc_show_hosts'); + $ds->addTable('cc_schedule', 'select id, starts, ends, file_id, clip_length, fade_in, fade_out, cue_in, cue_out, instance_id, playout_status from cc_schedule'); + + $this->assertDataSetsEqual( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml"), + $ds + ); + } + + public function testChangeRepeatTypeFromWeeklyToNoRepeat() + { + TestHelper::loginUser(); + + //test change repeat type from weekly to no-repeat + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + $showService->addUpdateShow($data); + + $data["add_show_repeats"] = 0; + $data["add_show_id"] = 1; + $showService = new Application_Service_ShowService(null, $data, true); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToNoRepeat.yml"), + $ds + ); + } + + public function testChangeRepeatTypeFromWeeklyToBiWeekly() + { + TestHelper::loginUser(); + + //test change repeat type weekly to bi-weekly + $data = ShowServiceData::getWeeklyRepeatNoEndNoRRData(); + $showService = new Application_Service_ShowService(null, $data); + $showService->addUpdateShow($data); + + $data["add_show_id"] = 1; + $data["add_show_repeat_type"] = 1; + $showService = new Application_Service_ShowService(null, $data, true); + $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 id, starts, ends, show_id, record, rebroadcast, instance_id, modified_instance 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( + new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_weeklyToBiWeekly.yml"), + $ds + ); + } +} diff --git a/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml b/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml new file mode 100644 index 000000000..e91a6b8e7 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/seed_show_service.yml @@ -0,0 +1,11 @@ +cc_pref: + - + id: '1' + subjid: null + keystr: shows_populated_until + valstr: '2044-02-07 00:00:00' + - + id: '2' + subjid: null + keystr: timezone + valstr: UTC diff --git a/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml b/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml new file mode 100644 index 000000000..f8febec14 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_ccShowInsertedIntoDatabase.yml @@ -0,0 +1,19 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false diff --git a/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml b/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml new file mode 100644 index 000000000..653735f43 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_changeRepeatDayUpdatesScheduleCorrectly.yml @@ -0,0 +1,79 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: true + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '2' + first_show: '2044-01-30' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '6' + repeat_type: '0' + next_pop_date: '2044-02-13' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '3' + starts: '2044-01-30 00:00:00' + ends: '2044-01-30 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-02-06 00:00:00' + ends: '2044-02-06 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_schedule: + - + id: '3' + starts: '2044-01-30 00:00:00' + ends: '2044-01-30 00:04:32' + file_id: '1' + clip_length: '00:04:32' + fade_in: '00:00:00.5' + fade_out: '00:00:00.5' + cue_in: '00:00:00' + cue_out: '00:04:32' + instance_id: '3' + playout_status: '1' + - + id: '4' + starts: '2044-02-06 00:00:00' + ends: '2044-02-06 00:04:32' + file_id: '1' + clip_length: '00:04:32' + fade_in: '00:00:00.5' + fade_out: '00:00:00.5' + cue_in: '00:00:00' + cue_out: '00:04:32' + instance_id: '4' + playout_status: '1' +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..9d9b152c1 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createBiWeeklyRepeatNoEndNoRRShow.yml @@ -0,0 +1,63 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '1' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml new file mode 100644 index 000000000..d215b40d7 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createLinkedShow.yml @@ -0,0 +1,90 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: true + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..5aaa9417a --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyMonthlyRepeatNoEndNoRRShow.yml @@ -0,0 +1,54 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: null + repeat_type: '2' + next_pop_date: '2044-03-01' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-02-01 00:00:00' + ends: '2044-02-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..5d7b10f43 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createMonthlyWeeklyRepeatNoEndNoRRShow.yml @@ -0,0 +1,54 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '3' + next_pop_date: '2044-03-04' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml new file mode 100644 index 000000000..029eb78de --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatNoRRShow.yml @@ -0,0 +1,45 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '-1' + next_pop_date: '2044-01-01' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml new file mode 100644 index 000000000..05ddeec2d --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createNoRepeatRRShow.yml @@ -0,0 +1,185 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '-1' + next_pop_date: '2044-01-01' + show_id: '1' + record: '1' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-02 00:00:00' + ends: '2044-01-02 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '3' + starts: '2044-01-03 00:00:00' + ends: '2044-01-03 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '4' + starts: '2044-01-04 00:00:00' + ends: '2044-01-04 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '5' + starts: '2044-01-05 00:00:00' + ends: '2044-01-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '6' + starts: '2044-01-06 00:00:00' + ends: '2044-01-06 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '7' + starts: '2044-01-07 00:00:00' + ends: '2044-01-07 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '8' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '9' + starts: '2044-01-09 00:00:00' + ends: '2044-01-09 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '10' + starts: '2044-01-10 00:00:00' + ends: '2044-01-10 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '11' + starts: '2044-01-11 00:00:00' + ends: '2044-01-11 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false +cc_show_rebroadcast: + - + id: '1' + day_offset: '1 days' + start_time: '00:00:00' + show_id: '1' + - + id: '2' + day_offset: '2 days' + start_time: '00:00:00' + show_id: '1' + - + id: '3' + day_offset: '3 days' + start_time: '00:00:00' + show_id: '1' + - + id: '4' + day_offset: '4 days' + start_time: '00:00:00' + show_id: '1' + - + id: '5' + day_offset: '5 days' + start_time: '00:00:00' + show_id: '1' + - + id: '6' + day_offset: '6 days' + start_time: '00:00:00' + show_id: '1' + - + id: '7' + day_offset: '7 days' + start_time: '00:00:00' + show_id: '1' + - + id: '8' + day_offset: '8 days' + start_time: '00:00:00' + show_id: '1' + - + id: '9' + day_offset: '9 days' + start_time: '00:00:00' + show_id: '1' + - + id: '10' + day_offset: '10 days' + start_time: '00:00:00' + show_id: '1' +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..8490ed56e --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createQuadWeeklyRepeatNoEndNoRRShow.yml @@ -0,0 +1,54 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '5' + next_pop_date: '2044-02-26' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..bffa9fe5f --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createTriWeeklyRepeatNoEndNoRRShow.yml @@ -0,0 +1,54 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '4' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml new file mode 100644 index 000000000..ebcf284eb --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatNoEndNoRRShow.yml @@ -0,0 +1,90 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml new file mode 100644 index 000000000..a7a48b8f2 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_createWeeklyRepeatRRShow.yml @@ -0,0 +1,208 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '1' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-02 00:00:00' + ends: '2044-01-02 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '3' + starts: '2044-01-03 12:00:00' + ends: '2044-01-03 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '1' + modified_instance: false + - + id: '4' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-09 00:00:00' + ends: '2044-01-09 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '4' + modified_instance: false + - + id: '6' + starts: '2044-01-10 12:00:00' + ends: '2044-01-10 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '4' + modified_instance: false + - + id: '7' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '8' + starts: '2044-01-16 00:00:00' + ends: '2044-01-16 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '7' + modified_instance: false + - + id: '9' + starts: '2044-01-17 12:00:00' + ends: '2044-01-17 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '7' + modified_instance: false + - + id: '10' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '11' + starts: '2044-01-23 00:00:00' + ends: '2044-01-23 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '10' + modified_instance: false + - + id: '12' + starts: '2044-01-24 12:00:00' + ends: '2044-01-24 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '10' + modified_instance: false + - + id: '13' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '14' + starts: '2044-01-30 00:00:00' + ends: '2044-01-30 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '13' + modified_instance: false + - + id: '15' + starts: '2044-01-31 12:00:00' + ends: '2044-01-31 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '13' + modified_instance: false + - + id: '16' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '1' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '17' + starts: '2044-02-06 00:00:00' + ends: '2044-02-06 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '16' + modified_instance: false + - + id: '18' + starts: '2044-02-07 12:00:00' + ends: '2044-02-07 13:00:00' + show_id: '1' + record: '0' + rebroadcast: '1' + instance_id: '16' + modified_instance: false +cc_show_rebroadcast: + - + id: '1' + day_offset: '1 days' + start_time: '00:00:00' + show_id: '1' + - + id: '2' + day_offset: '2 days' + start_time: '12:00:00' + show_id: '1' +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml new file mode 100644 index 000000000..3f8801b58 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_deleteRepeatingShow.yml @@ -0,0 +1,6 @@ +cc_show: +cc_show_days: +cc_show_instances: +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml new file mode 100644 index 000000000..d55a468e5 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstance.yml @@ -0,0 +1,90 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml new file mode 100644 index 000000000..20e4ae2f0 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_deleteShowInstanceAndAllFollowing.yml @@ -0,0 +1,204 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: '2044-01-16' + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' + - + id: '2' + first_show: '2044-01-04' + last_show: '2044-01-19' + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '1' + repeat_type: '0' + next_pop_date: '2044-02-08' + show_id: '1' + record: '0' + - + id: '3' + first_show: '2044-01-05' + last_show: '2044-01-20' + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '2' + repeat_type: '0' + next_pop_date: '2044-02-09' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '7' + starts: '2044-01-04 00:00:00' + ends: '2044-01-04 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '8' + starts: '2044-01-11 00:00:00' + ends: '2044-01-11 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '9' + starts: '2044-01-18 00:00:00' + ends: '2044-01-18 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '10' + starts: '2044-01-25 00:00:00' + ends: '2044-01-25 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '11' + starts: '2044-02-01 00:00:00' + ends: '2044-02-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '12' + starts: '2044-01-05 00:00:00' + ends: '2044-01-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '13' + starts: '2044-01-12 00:00:00' + ends: '2044-01-12 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '14' + starts: '2044-01-19 00:00:00' + ends: '2044-01-19 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '15' + starts: '2044-01-26 00:00:00' + ends: '2044-01-26 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '16' + starts: '2044-02-02 00:00:00' + ends: '2044-02-02 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml new file mode 100644 index 000000000..21005aabe --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowChangeNoEndOption.yml @@ -0,0 +1,54 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: '2044-01-10' + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-01-15' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml new file mode 100644 index 000000000..8b41176e6 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_editRepeatingShowInstance.yml @@ -0,0 +1,111 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' + - + id: '2' + first_show: '2044-01-08' + last_show: '2044-01-09' + start_time: '01:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '-1' + next_pop_date: '2044-01-08' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: true + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '7' + starts: '2044-01-08 01:00:00' + ends: '2044-01-08 02:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml b/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml new file mode 100644 index 000000000..653735f43 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_removeFirstRepeatShowDayUpdatesScheduleCorrectly.yml @@ -0,0 +1,79 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: true + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '2' + first_show: '2044-01-30' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '6' + repeat_type: '0' + next_pop_date: '2044-02-13' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '3' + starts: '2044-01-30 00:00:00' + ends: '2044-01-30 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-02-06 00:00:00' + ends: '2044-02-06 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_schedule: + - + id: '3' + starts: '2044-01-30 00:00:00' + ends: '2044-01-30 00:04:32' + file_id: '1' + clip_length: '00:04:32' + fade_in: '00:00:00.5' + fade_out: '00:00:00.5' + cue_in: '00:00:00' + cue_out: '00:04:32' + instance_id: '3' + playout_status: '1' + - + id: '4' + starts: '2044-02-06 00:00:00' + ends: '2044-02-06 00:04:32' + file_id: '1' + clip_length: '00:04:32' + fade_in: '00:00:00.5' + fade_out: '00:00:00.5' + cue_in: '00:00:00' + cue_out: '00:04:32' + instance_id: '4' + playout_status: '1' +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml b/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml new file mode 100644 index 000000000..88ccf868f --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_repeatShowCreationWhenUserMovesForwardInCalendar.yml @@ -0,0 +1,90 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '1' + next_pop_date: '2044-03-25' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-02-12 00:00:00' + ends: '2044-02-12 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-02-26 00:00:00' + ends: '2044-02-26 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-03-11 00:00:00' + ends: '2044-03-11 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml b/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml new file mode 100644 index 000000000..a3ebb56f4 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_unlinkLinkedShow.yml @@ -0,0 +1,90 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: false + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '1' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '0' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '2' + starts: '2044-01-08 00:00:00' + ends: '2044-01-08 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '3' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '4' + starts: '2044-01-22 00:00:00' + ends: '2044-01-22 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '5' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '6' + starts: '2044-02-05 00:00:00' + ends: '2044-02-05 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml new file mode 100644 index 000000000..ee630e54c --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToBiWeekly.yml @@ -0,0 +1,63 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '2' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '1' + next_pop_date: '2044-02-12' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '7' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '8' + starts: '2044-01-15 00:00:00' + ends: '2044-01-15 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false + - + id: '9' + starts: '2044-01-29 00:00:00' + ends: '2044-01-29 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml new file mode 100644 index 000000000..619f172e3 --- /dev/null +++ b/airtime_mvc/tests/application/services/database/datasets/test_weeklyToNoRepeat.yml @@ -0,0 +1,45 @@ +cc_show: + - + id: '1' + name: 'test show' + url: null + genre: null + description: null + color: ffffff + background_color: '364492' + live_stream_using_airtime_auth: false + live_stream_using_custom_auth: false + live_stream_user: null + live_stream_pass: null + linked: false + is_linkable: true + image_path: '' + has_autoplaylist: false + autoplaylist_id: null + autoplaylist_repeat: false +cc_show_days: + - + id: '2' + first_show: '2044-01-01' + last_show: null + start_time: '00:00:00' + timezone: UTC + duration: '01:00' + day: '5' + repeat_type: '-1' + next_pop_date: '2044-01-01' + show_id: '1' + record: '0' +cc_show_instances: + - + id: '1' + starts: '2044-01-01 00:00:00' + ends: '2044-01-01 01:00:00' + show_id: '1' + record: '0' + rebroadcast: '0' + instance_id: null + modified_instance: false +cc_show_rebroadcast: +cc_show_hosts: + diff --git a/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php b/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php new file mode 100644 index 000000000..0e70df10c --- /dev/null +++ b/airtime_mvc/tests/application/services/unit/ShowServiceUnitTest.php @@ -0,0 +1,139 @@ +_reflectionOfShowService = new ReflectionClass('Application_Service_ShowService'); + + $this->_showService = new Application_Service_ShowService(); + } + + public function testFormatShowDuration() + { + $duration = Application_Service_ShowService::formatShowDuration("01h 00m"); + $this->assertEquals("01:00", $duration); + + $duration = Application_Service_ShowService::formatShowDuration("00h 05m"); + $this->assertEquals("00:05", $duration); + + $duration = Application_Service_ShowService::formatShowDuration("03h 55m"); + $this->assertEquals("03:55", $duration); + } + + public function testCalculateEndDate() + { + $method = $this->_reflectionOfShowService->getMethod('calculateEndDate'); + $method->setAccessible(true); + + $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getNoRepeatNoRRData())); + $this->assertEquals(null, $end); + + $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatWithEndNoRRData())); + $this->assertEquals(new DateTime("2044-01-27", new DateTimeZone("UTC")), $end); + + $end = $method->invokeArgs($this->_showService, array(ShowServiceData::getWeeklyRepeatNoEndNoRRData())); + $this->assertEquals(null, $end); + } + + public function testGetMonthlyWeeklyRepeatInterval() + { + $method = $this->_reflectionOfShowService->getMethod('getMonthlyWeeklyRepeatInterval'); + $method->setAccessible(true); + + $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), new DateTimeZone("UTC"))); + $this->assertEquals(array("first", "Friday"), $repeatInterval); + + $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-12"), new DateTimeZone("UTC"))); + $this->assertEquals(array("second", "Tuesday"), $repeatInterval); + + $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-18"), new DateTimeZone("UTC"))); + $this->assertEquals(array("third", "Monday"), $repeatInterval); + + $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-28"), new DateTimeZone("UTC"))); + $this->assertEquals(array("fourth", "Thursday"), $repeatInterval); + + $repeatInterval = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), new DateTimeZone("UTC"))); + $this->assertEquals(array("fifth", "Saturday"), $repeatInterval); + } + + public function testGetNextMonthlyMonthlyRepeatDate() + { + $method = $this->_reflectionOfShowService->getMethod('getNextMonthlyMonthlyRepeatDate'); + $method->setAccessible(true); + + $next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-01"), "UTC", "00:00")); + $this->assertEquals(new DateTime("2044-02-01", new DateTimeZone("UTC")), $next); + + $next = $method->invokeArgs($this->_showService, array(new DateTime("2044-01-30"), "UTC", "00:00")); + $this->assertEquals(new DateTime("2044-03-30", new DateTimeZone("UTC")), $next); + } + + public function testGetNextMonthlyWeeklyRepeatDate() + { + $method = $this->_reflectionOfShowService->getMethod('getNextMonthlyWeeklyRepeatDate'); + $method->setAccessible(true); + + $next = $method->invokeArgs($this->_showService, array( + new DateTime("2044-02-01"), "UTC", "00:00", "first", "Friday")); + $this->assertEquals(new DateTime("2044-02-05", new DateTimeZone("UTC")), $next); + + $next = $method->invokeArgs($this->_showService, array( + new DateTime("2044-02-01"), "UTC", "00:00", "fifth", "Saturday")); + $this->assertEquals(new DateTime("2044-04-30", new DateTimeZone("UTC")), $next); + + $next = $method->invokeArgs($this->_showService, array( + new DateTime("2044-02-01"), "UTC", "00:00", "fourth", "Monday")); + $this->assertEquals(new DateTime("2044-02-22", new DateTimeZone("UTC")), $next); + } + + public function testCreateUTCStartEndDateTime() + { + $method = $this->_reflectionOfShowService->getMethod('createUTCStartEndDateTime'); + $method->setAccessible(true); + + $utcTimezone = new DateTimeZone("UTC"); + + //America/Toronto + $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto")); + $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto")); + + $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); + $this->assertEquals(array( + $localStartDT->setTimezone($utcTimezone),$localEndDT->setTimezone($utcTimezone)), $dt); + + //America/Toronto with offset for rebroadcast shows + $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Toronto")); + $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Toronto")); + + $localRebroadcastStartDT = new DateTime("2044-01-02 06:30", new DateTimeZone("America/Toronto")); + $localRebroadcastEndDT = new DateTime("2044-01-02 07:30", new DateTimeZone("America/Toronto")); + + $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00", + array("days" => "1", "hours" => "06", "mins" => "30"))); + $this->assertEquals(array( + $localRebroadcastStartDT->setTimezone($utcTimezone),$localRebroadcastEndDT->setTimezone($utcTimezone)), $dt); + + //Australia/Brisbane + $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("Australia/Brisbane")); + $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("Australia/Brisbane")); + + $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); + $this->assertEquals(array( + $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt); + + //America/Vancouver + $localStartDT = new DateTime("2044-01-01 06:30", new DateTimeZone("America/Vancouver")); + $localEndDT = new DateTime("2044-01-01 07:30", new DateTimeZone("America/Vancouver")); + + $dt = $method->invokeArgs($this->_showService, array($localStartDT, "01:00")); + $this->assertEquals(array( + $localStartDT->setTimezone($utcTimezone), $localEndDT->setTimezone($utcTimezone)), $dt); + } +} diff --git a/airtime_mvc/tests/application/testdata/BlockModelData.php b/airtime_mvc/tests/application/testdata/BlockModelData.php new file mode 100644 index 000000000..7a755f3a8 --- /dev/null +++ b/airtime_mvc/tests/application/testdata/BlockModelData.php @@ -0,0 +1,51 @@ + "sp_type", "value" => 0), + Array("name" => "sp_type", "value" => 0), + Array("name" => "sp_repeat_tracks", "value" => 0), + Array("name" => "sp_sort_options", "value" => "newest"), + Array("name" => "sp_limit_value", "value" => 1), + Array("name" => "sp_limit_options", "value" => "items"), + Array("name" => "sp_criteria_field_0_0", "value" => "label"), + Array("name" => "sp_criteria_modifier_0_0", "value" => "contains"), + Array("name" => "sp_criteria_value_0_0", "value" => "nada"), + Array("name" => "sp_overflow_tracks", "value" => 0), + ); + } + + + public static function getCriteriaMultiTrackAndAlbum1Hour() + { + return array ( + Array("name" => "sp_type" , "value" => 1), + Array("name" => "sp_repeat_tracks", "value" => 0), + Array("name" => "sp_sort_options", "value" => "random"), + Array("name" => "sp_limit_value", "value" => 1), + Array("name" => "sp_limit_options", "value" => "hours"), + Array("name" => "sp_overflow_tracks", "value" => 0), + Array("name" => "sp_criteria_field_0_0", "value" => "album_title"), + Array("name" => "sp_criteria_modifier_0_0", "value" => "is"), + Array("name" => "sp_criteria_value_0_0", "value" => "album1"), + Array("name" => "sp_criteria_field_0_1", "value" => "album_title"), + Array("name" => "sp_criteria_modifier_0_1", "value" => "is"), + Array("name" => "sp_criteria_value_0_1", "value" => "album2"), + Array("name" => "sp_criteria_field_1_0", "value" => "track_title"), + Array("name" => "sp_criteria_modifier_1_0", "value" => "is"), + Array("name" => "sp_criteria_value_1_0", "value" => "track1"), + Array("name" => "sp_criteria_field_1_1", "value" => "track_title"), + Array("name" => "sp_criteria_modifier_1_1", "value" => "is"), + Array("name" => "sp_criteria_value_1_1", "value" => "track2"), + Array("name" => "sp_criteria_field_1_2", "value" => "track_title"), + Array("name" => "sp_criteria_modifier_1_2", "value" => "is"), + Array("name" => "sp_criteria_value_1_2", "value" => "track3"), + Array("name" => "sp_criteria_field_2_0", "value" => "length"), + Array("name" => "sp_criteria_modifier_2_0", "value" => "is greater than"), + Array("name" => "sp_criteria_value_2_0", "value" => "00:01:00"), + ); + + } +} \ No newline at end of file diff --git a/airtime_mvc/tests/application/testdata/ShowServiceData.php b/airtime_mvc/tests/application/testdata/ShowServiceData.php new file mode 100644 index 000000000..ca3c1019d --- /dev/null +++ b/airtime_mvc/tests/application/testdata/ShowServiceData.php @@ -0,0 +1,513 @@ + -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2044-01-01", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2044-01-01", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 0, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2044-01-01", + "add_show_no_end" => 1, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 0, + "add_show_rebroadcast" => 0, + "add_show_rebroadcast_date_absolute_1" => null, + "add_show_rebroadcast_time_absolute_1" => null, + "add_show_rebroadcast_date_absolute_2" => null, + "add_show_rebroadcast_time_absolute_2" => null, + "add_show_rebroadcast_date_absolute_3" => null, + "add_show_rebroadcast_time_absolute_3" => null, + "add_show_rebroadcast_date_absolute_4" => null, + "add_show_rebroadcast_time_absolute_4" => null, + "add_show_rebroadcast_date_absolute_5" => null, + "add_show_rebroadcast_time_absolute_5" => null, + "add_show_rebroadcast_date_absolute_6" => null, + "add_show_rebroadcast_time_absolute_6" => null, + "add_show_rebroadcast_date_absolute_7" => null, + "add_show_rebroadcast_time_absolute_7" => null, + "add_show_rebroadcast_date_absolute_8" => null, + "add_show_rebroadcast_time_absolute_8" => null, + "add_show_rebroadcast_date_absolute_9" => null, + "add_show_rebroadcast_time_absolute_9" => null, + "add_show_rebroadcast_date_absolute_10" => null, + "add_show_rebroadcast_time_absolute_10" => null, + "add_show_rebroadcast_date_1" => null, + "add_show_rebroadcast_time_1" => null, + "add_show_rebroadcast_date_2" => null, + "add_show_rebroadcast_time_2" => null, + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => null + ); + } + + public static function getWeeklyRepeatNoEndNoRRData() + { + return array( + "add_show_id" => -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2044-01-01", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2044-01-01", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 1, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2044-01-01", + "add_show_no_end" => 1, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 0, + "add_show_rebroadcast" => 0, + "add_show_rebroadcast_date_absolute_1" => null, + "add_show_rebroadcast_time_absolute_1" => null, + "add_show_rebroadcast_date_absolute_2" => null, + "add_show_rebroadcast_time_absolute_2" => null, + "add_show_rebroadcast_date_absolute_3" => null, + "add_show_rebroadcast_time_absolute_3" => null, + "add_show_rebroadcast_date_absolute_4" => null, + "add_show_rebroadcast_time_absolute_4" => null, + "add_show_rebroadcast_date_absolute_5" => null, + "add_show_rebroadcast_time_absolute_5" => null, + "add_show_rebroadcast_date_absolute_6" => null, + "add_show_rebroadcast_time_absolute_6" => null, + "add_show_rebroadcast_date_absolute_7" => null, + "add_show_rebroadcast_time_absolute_7" => null, + "add_show_rebroadcast_date_absolute_8" => null, + "add_show_rebroadcast_time_absolute_8" => null, + "add_show_rebroadcast_date_absolute_9" => null, + "add_show_rebroadcast_time_absolute_9" => null, + "add_show_rebroadcast_date_absolute_10" => null, + "add_show_rebroadcast_time_absolute_10" => null, + "add_show_rebroadcast_date_1" => null, + "add_show_rebroadcast_time_1" => null, + "add_show_rebroadcast_date_2" => null, + "add_show_rebroadcast_time_2" => null, + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => array(5) + ); + } + + public static function getWeeklyRepeatWithEndNoRRData() + { + return array( + "add_show_id" => -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2044-01-01", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2044-01-01", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 1, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2044-01-26", + "add_show_no_end" => 0, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 0, + "add_show_rebroadcast" => 0, + "add_show_rebroadcast_date_absolute_1" => null, + "add_show_rebroadcast_time_absolute_1" => null, + "add_show_rebroadcast_date_absolute_2" => null, + "add_show_rebroadcast_time_absolute_2" => null, + "add_show_rebroadcast_date_absolute_3" => null, + "add_show_rebroadcast_time_absolute_3" => null, + "add_show_rebroadcast_date_absolute_4" => null, + "add_show_rebroadcast_time_absolute_4" => null, + "add_show_rebroadcast_date_absolute_5" => null, + "add_show_rebroadcast_time_absolute_5" => null, + "add_show_rebroadcast_date_absolute_6" => null, + "add_show_rebroadcast_time_absolute_6" => null, + "add_show_rebroadcast_date_absolute_7" => null, + "add_show_rebroadcast_time_absolute_7" => null, + "add_show_rebroadcast_date_absolute_8" => null, + "add_show_rebroadcast_time_absolute_8" => null, + "add_show_rebroadcast_date_absolute_9" => null, + "add_show_rebroadcast_time_absolute_9" => null, + "add_show_rebroadcast_date_absolute_10" => null, + "add_show_rebroadcast_time_absolute_10" => null, + "add_show_rebroadcast_date_1" => null, + "add_show_rebroadcast_time_1" => null, + "add_show_rebroadcast_date_2" => null, + "add_show_rebroadcast_time_2" => null, + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => array(5) + ); + } + + public static function getWeeklyRepeatDays() + { + return array(1,2,3,4,5); + } + + public static function getDailyRepeatDays() + { + return array(0,1,2,3,4,5,6); + } + + public static function getEditRepeatInstanceData() + { + return array( + "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, + "add_show_start_date" => "2044-01-08", + "add_show_start_time" => "01:00", + "add_show_end_date_no_repeat" => "2044-01-08", + "add_show_end_time" => "02:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 0, + "add_show_linked" => 0, + "add_show_no_end" => 0, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "add_show_record" => 0, + "add_show_rebroadcast" => 0, + "add_show_hosts" => null + ); + } + + public static function getOverlappingShowCheckTestData() + { + return array( + "add_show_id" => -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2014-01-05", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2014-01-05", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 1, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2014-01-05", + "add_show_no_end" => 1, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 0, + "add_show_rebroadcast" => 0, + "add_show_rebroadcast_date_absolute_1" => null, + "add_show_rebroadcast_time_absolute_1" => null, + "add_show_rebroadcast_date_absolute_2" => null, + "add_show_rebroadcast_time_absolute_2" => null, + "add_show_rebroadcast_date_absolute_3" => null, + "add_show_rebroadcast_time_absolute_3" => null, + "add_show_rebroadcast_date_absolute_4" => null, + "add_show_rebroadcast_time_absolute_4" => null, + "add_show_rebroadcast_date_absolute_5" => null, + "add_show_rebroadcast_time_absolute_5" => null, + "add_show_rebroadcast_date_absolute_6" => null, + "add_show_rebroadcast_time_absolute_6" => null, + "add_show_rebroadcast_date_absolute_7" => null, + "add_show_rebroadcast_time_absolute_7" => null, + "add_show_rebroadcast_date_absolute_8" => null, + "add_show_rebroadcast_time_absolute_8" => null, + "add_show_rebroadcast_date_absolute_9" => null, + "add_show_rebroadcast_time_absolute_9" => null, + "add_show_rebroadcast_date_absolute_10" => null, + "add_show_rebroadcast_time_absolute_10" => null, + "add_show_rebroadcast_date_1" => null, + "add_show_rebroadcast_time_1" => null, + "add_show_rebroadcast_date_2" => null, + "add_show_rebroadcast_time_2" => null, + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => array(0,1,2,3,4,5,6) + ); + } + + /** Returns form data for a non-repeating, record and rebroadcast(RR) show **/ + public static function getNoRepeatRRData() + { + return array( + "add_show_id" => -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2044-01-01", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2044-01-01", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 0, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2044-01-01", + "add_show_no_end" => 1, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 1, + "add_show_rebroadcast" => 1, + "add_show_rebroadcast_date_absolute_1" => "2044-01-02", + "add_show_rebroadcast_time_absolute_1" => "00:00", + "add_show_rebroadcast_date_absolute_2" => "2044-01-03", + "add_show_rebroadcast_time_absolute_2" => "00:00", + "add_show_rebroadcast_date_absolute_3" => "2044-01-04", + "add_show_rebroadcast_time_absolute_3" => "00:00", + "add_show_rebroadcast_date_absolute_4" => "2044-01-05", + "add_show_rebroadcast_time_absolute_4" => "00:00", + "add_show_rebroadcast_date_absolute_5" => "2044-01-06", + "add_show_rebroadcast_time_absolute_5" => "00:00", + "add_show_rebroadcast_date_absolute_6" => "2044-01-07", + "add_show_rebroadcast_time_absolute_6" => "00:00", + "add_show_rebroadcast_date_absolute_7" => "2044-01-08", + "add_show_rebroadcast_time_absolute_7" => "00:00", + "add_show_rebroadcast_date_absolute_8" => "2044-01-09", + "add_show_rebroadcast_time_absolute_8" => "00:00", + "add_show_rebroadcast_date_absolute_9" => "2044-01-10", + "add_show_rebroadcast_time_absolute_9" => "00:00", + "add_show_rebroadcast_date_absolute_10" => "2044-01-11", + "add_show_rebroadcast_time_absolute_10" => "00:00", + "add_show_rebroadcast_date_1" => null, + "add_show_rebroadcast_time_1" => null, + "add_show_rebroadcast_date_2" => null, + "add_show_rebroadcast_time_2" => null, + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => null + ); + } + + public static function getWeeklyRepeatRRData() + { + return array( + "add_show_id" => -1, + "add_show_instance_id" => -1, + "add_show_name" => "test show", + "add_show_url" => null, + "add_show_genre" => null, + "add_show_description" => null, + "add_show_start_date" => "2044-01-01", + "add_show_start_time" => "00:00", + "add_show_end_date_no_repeat" => "2044-01-01", + "add_show_end_time" => "01:00", + "add_show_duration" => "01h 00m", + "add_show_timezone" => "UTC", + "add_show_has_autoplaylist" => false, + "add_show_autoplaylist_repeat" => false, + "add_show_autoplaylist_id" => null, + "add_show_repeats" => 1, + "add_show_linked" => 0, + "add_show_repeat_type" => 0, + "add_show_monthly_repeat_type" => 2, + "add_show_end_date" => "2044-01-01", + "add_show_no_end" => 1, + "cb_airtime_auth" => 0, + "cb_custom_auth" => 0, + "custom_username" => null, + "custom_password" => null, + "add_show_record" => 1, + "add_show_rebroadcast" => 1, + "add_show_rebroadcast_date_absolute_1" => null, + "add_show_rebroadcast_time_absolute_1" => null, + "add_show_rebroadcast_date_absolute_2" => null, + "add_show_rebroadcast_time_absolute_2" => null, + "add_show_rebroadcast_date_absolute_3" => null, + "add_show_rebroadcast_time_absolute_3" => null, + "add_show_rebroadcast_date_absolute_4" => null, + "add_show_rebroadcast_time_absolute_4" => null, + "add_show_rebroadcast_date_absolute_5" => null, + "add_show_rebroadcast_time_absolute_5" => null, + "add_show_rebroadcast_date_absolute_6" => null, + "add_show_rebroadcast_time_absolute_6" => null, + "add_show_rebroadcast_date_absolute_7" => null, + "add_show_rebroadcast_time_absolute_7" => null, + "add_show_rebroadcast_date_absolute_8" => null, + "add_show_rebroadcast_time_absolute_8" => null, + "add_show_rebroadcast_date_absolute_9" => null, + "add_show_rebroadcast_time_absolute_9" => null, + "add_show_rebroadcast_date_absolute_10" => null, + "add_show_rebroadcast_time_absolute_10" => null, + "add_show_rebroadcast_date_1" => "1 days", + "add_show_rebroadcast_time_1" => "00:00", + "add_show_rebroadcast_date_2" => "2 days", + "add_show_rebroadcast_time_2" => "12:00", + "add_show_rebroadcast_date_3" => null, + "add_show_rebroadcast_time_3" => null, + "add_show_rebroadcast_date_4" => null, + "add_show_rebroadcast_time_4" => null, + "add_show_rebroadcast_date_5" => null, + "add_show_rebroadcast_time_5" => null, + "add_show_rebroadcast_date_6" => null, + "add_show_rebroadcast_time_6" => null, + "add_show_rebroadcast_date_7" => null, + "add_show_rebroadcast_time_7" => null, + "add_show_rebroadcast_date_8" => null, + "add_show_rebroadcast_time_8" => null, + "add_show_rebroadcast_date_9" => null, + "add_show_rebroadcast_time_9" => null, + "add_show_rebroadcast_date_10" => null, + "add_show_rebroadcast_time_10" => null, + "add_show_hosts_autocomplete" => null, + "add_show_background_color" => "364492", + "add_show_color" => "ffffff", + "add_show_hosts" => null, + "add_show_day_check" => array(5) + ); + } +} diff --git a/airtime_mvc/tests/conf/airtime.conf b/airtime_mvc/tests/conf/airtime.conf new file mode 100644 index 000000000..e64a4b897 --- /dev/null +++ b/airtime_mvc/tests/conf/airtime.conf @@ -0,0 +1,51 @@ +[database] + +host = localhost +dbname = libretime_test +dbuser = libretime +dbpass = libretime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = airtime_tests +password = airtime_tests +vhost = /airtime_tests + +[general] +dev_env = testing +api_key = H2NRICX6CM8F50CU123C +web_server_user = www-data +airtime_dir = /usr/share/airtime +base_url = localhost +base_port = 80 +base_dir = / +cache_ahead_hours = 1 +station_id = teststation + +[current_backend] +storage_backend=file + +[monit] +monit_user = guest +monit_password = airtime + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 +soundcloud_client_id = 0 +soundcloud_client_secret = 0 +soundcloud_redirect_uri = http://soundcloud.example.org/redirect + +[ldap] +hostname = ldap.example.org +binddn = 'uid=libretime,cn=sysaccounts,cn=etc,dc=int,dc=example,dc=org' +password = hackme +account_domain = INT.EXAMPLE.ORG +basedn = 'cn=users,cn=accounts,dc=int,dc=example,dc=org' +filter_field = uid +groupmap_guest = 'cn=guest,cn=groups,cn=accounts,dc=int,dc=example,dc=org' +groupmap_host = 'cn=host,cn=groups,cn=accounts,dc=int,dc=example,dc=org' +groupmap_program_manager = 'cn=program_manager,cn=groups,cn=accounts,dc=int,dc=example,dc=org' +groupmap_admin = 'cn=admins,cn=groups,cn=accounts,dc=int,dc=example,dc=org' +groupmap_superadmin = 'cn=superadmin,cn=groups,cn=accounts,dc=int,dc=example,dc=org' diff --git a/airtime_mvc/tests/conf/testing/airtime.conf b/airtime_mvc/tests/conf/testing/airtime.conf new file mode 100644 index 000000000..88930ecf9 --- /dev/null +++ b/airtime_mvc/tests/conf/testing/airtime.conf @@ -0,0 +1,35 @@ +[database] + +host = localhost +dbname = libretime_test +dbuser = libretime +dbpass = libretime + +[rabbitmq] +host = 127.0.0.1 +port = 5672 +user = airtime_tests +password = airtime_tests +vhost = /airtime_tests + +[general] +dev_env = testing +api_key = H2NRICX6CM8F50CU123C +web_server_user = www-data +airtime_dir = /usr/share/airtime +base_url = localhost +base_port = 80 +base_dir = / +cache_ahead_hours = 1 +station_id = teststation + +[monit] +monit_user = guest +monit_password = airtime + +[soundcloud] +connection_retries = 3 +time_between_retries = 60 +soundcloud_client_id = 0 +soundcloud_client_secret = 0 +soundcloud_redirect_uri = http://soundcloud.example.org/redirect diff --git a/airtime_mvc/tests/log/.keep b/airtime_mvc/tests/log/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/airtime_mvc/tests/phpunit.xml b/airtime_mvc/tests/phpunit.xml new file mode 100644 index 000000000..cc154d7a0 --- /dev/null +++ b/airtime_mvc/tests/phpunit.xml @@ -0,0 +1,30 @@ + + + ./ + + + + + ../application/ + + ../application/ + ../application/Bootstrap.php + ../application/controllers/ErrorController.php + + + + + + + + + + + + + diff --git a/airtime_mvc/tests/runtests.sh b/airtime_mvc/tests/runtests.sh new file mode 100755 index 000000000..61283842d --- /dev/null +++ b/airtime_mvc/tests/runtests.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +#Create a RabbitMQ airtime_tests user +#This is necessary for tests to run + +rabbitmqctl start_app + +RABBITMQ_VHOST="/airtime_tests" +RABBITMQ_USER="airtime_tests" +RABBITMQ_PASSWORD="airtime_tests" +EXCHANGES="airtime-pypo|pypo-fetch|airtime-analyzer|media-monitor" + +rabbitmqctl list_vhosts | grep $RABBITMQ_VHOST +RESULT="$?" + +if [ $RESULT = "0" ]; then + rabbitmqctl delete_vhost $RABBITMQ_VHOST + rabbitmqctl delete_user $RABBITMQ_USER +fi + +rabbitmqctl add_vhost $RABBITMQ_VHOST +rabbitmqctl add_user $RABBITMQ_USER $RABBITMQ_PASSWORD +rabbitmqctl set_permissions -p $RABBITMQ_VHOST $RABBITMQ_USER "$EXCHANGES" "$EXCHANGES" "$EXCHANGES" + +export RABBITMQ_USER +export RABBITMQ_PASSWORD +export RABBITMQ_VHOST + +export AIRTIME_UNIT_TEST="1" + +#Change the working directory to this script's directory +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $DIR + +#Run the unit tests +phpunit --verbose --log-junit test_results.xml + From 2160daea00ee79ddcafa3e75f7dc37e85c6b3ec9 Mon Sep 17 00:00:00 2001 From: rjhelms Date: Thu, 19 Nov 2020 14:52:52 -0500 Subject: [PATCH 09/16] Fix replaygain_analyzer in Python 3.5 'text' argument was added in Python 3.7 as an alias of 'universal_newlines'. Using 'universal_newlines' works on Python 3.5/3.6 and should be forward-compatible. --- .../airtime_analyzer/airtime_analyzer/replaygain_analyzer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/airtime_analyzer/airtime_analyzer/replaygain_analyzer.py b/python_apps/airtime_analyzer/airtime_analyzer/replaygain_analyzer.py index 309f73ce6..0c2c4d963 100644 --- a/python_apps/airtime_analyzer/airtime_analyzer/replaygain_analyzer.py +++ b/python_apps/airtime_analyzer/airtime_analyzer/replaygain_analyzer.py @@ -21,7 +21,7 @@ class ReplayGainAnalyzer(Analyzer): command = [ReplayGainAnalyzer.REPLAYGAIN_EXECUTABLE, '-d', filename] try: results = subprocess.check_output(command, stderr=subprocess.STDOUT, - close_fds=True, text=True) + close_fds=True, universal_newlines=True) gain_match = r'Calculating Replay Gain information \.\.\.(?:\n|.)*?:([\d.-]*) dB' replaygain = re.search(gain_match, results).group(1) metadata['replay_gain'] = float(replaygain) From ddd02de3b14342bf67f6797f5ca1b8f27766d5bf Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 19 Nov 2020 21:51:55 -0500 Subject: [PATCH 10/16] Adding Python 3.6 test; adding failure flexibility on Python 3.7, 3.8 --- .travis.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f53d7b8d8..94c8a87b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,11 +48,14 @@ jobs: - language: php php: 5.6 stage: test +# - language: python +# python: 3.8 +# stage: test +# - language: python +# python: 3.7 +# stage: test - language: python - python: 3.8 - stage: test - - language: python - python: 3.7 + python: 3.6 stage: test - language: python python: 3.5 @@ -77,6 +80,11 @@ jobs: php: 7.3 - language: php php: 7.2 + # Ubuntu Bionic cloud image uses Python 3.6.9 + - language: python + python: 3.8 + - language: python + python: 3.7 # https://github.com/LibreTime/libretime/issues/1041 - language: python python: 3.5 From ada9dec45aa921dc185f6550d92f53a2783968ca Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 09:23:27 -0500 Subject: [PATCH 11/16] Removing pyenv instructions --- travis/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/install.sh b/travis/install.sh index 47e36a6ce..c9bb43c78 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -6,7 +6,7 @@ if [[ -n "$TRAVIS_PHP_VERSION" ]]; then composer install fi if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then - pyenv local $TRAVIS_PYTHON_VERSION +# pyenv local $TRAVIS_PYTHON_VERSION pushd python_apps/airtime_analyzer pip3 install -e . popd From 9077db76789836bbeca4295f53064852ffc0eefc Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 11:04:21 -0500 Subject: [PATCH 12/16] Balancing this PR with #1092 --- .travis.yml | 10 +++++----- travis/install.sh | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94c8a87b0..80ffc51c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,9 +48,9 @@ jobs: - language: php php: 5.6 stage: test -# - language: python -# python: 3.8 -# stage: test + - language: python + python: 3.8 + stage: test # - language: python # python: 3.7 # stage: test @@ -83,8 +83,8 @@ jobs: # Ubuntu Bionic cloud image uses Python 3.6.9 - language: python python: 3.8 - - language: python - python: 3.7 +# - language: python +# python: 3.7 # https://github.com/LibreTime/libretime/issues/1041 - language: python python: 3.5 diff --git a/travis/install.sh b/travis/install.sh index c9bb43c78..fe5cb591c 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -6,7 +6,8 @@ if [[ -n "$TRAVIS_PHP_VERSION" ]]; then composer install fi if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then -# pyenv local $TRAVIS_PYTHON_VERSION + pyenv install --skip-existing $TRAVIS_PYTHON_VERSION + pyenv local $TRAVIS_PYTHON_VERSION pushd python_apps/airtime_analyzer pip3 install -e . popd From ae0ed7f8b9dc571d65d64607a75b4452170ea098 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 11:14:17 -0500 Subject: [PATCH 13/16] New push to wake up Travis Removes commented lines entirely --- .travis.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 80ffc51c3..9d403de57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,12 +48,9 @@ jobs: - language: php php: 5.6 stage: test - - language: python - python: 3.8 - stage: test -# - language: python -# python: 3.7 -# stage: test + - language: python + python: 3.8 + stage: test - language: python python: 3.6 stage: test @@ -83,8 +80,6 @@ jobs: # Ubuntu Bionic cloud image uses Python 3.6.9 - language: python python: 3.8 -# - language: python -# python: 3.7 # https://github.com/LibreTime/libretime/issues/1041 - language: python python: 3.5 From 3f27d2f64032166be7f9e765699be2a050d2ee57 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 13:36:43 -0500 Subject: [PATCH 14/16] Adding libcairo2-dev to test dependencies --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9d403de57..4196b0f19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,6 +33,7 @@ addons: - python3-gi-cairo - python-cairo - pkg-config + - libcairo2-dev jobs: include: From 41e1a307354f4c34a80115746d0b07b89c415b8b Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 14:16:20 -0500 Subject: [PATCH 15/16] Removing references to pyenv local --- travis/install.sh | 2 -- travis/test.sh | 1 - 2 files changed, 3 deletions(-) diff --git a/travis/install.sh b/travis/install.sh index fe5cb591c..edcaaffb3 100755 --- a/travis/install.sh +++ b/travis/install.sh @@ -6,8 +6,6 @@ if [[ -n "$TRAVIS_PHP_VERSION" ]]; then composer install fi if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then - pyenv install --skip-existing $TRAVIS_PYTHON_VERSION - pyenv local $TRAVIS_PYTHON_VERSION pushd python_apps/airtime_analyzer pip3 install -e . popd diff --git a/travis/test.sh b/travis/test.sh index 81aad4a26..ab51c72e8 100755 --- a/travis/test.sh +++ b/travis/test.sh @@ -8,7 +8,6 @@ if [[ -n "$TRAVIS_PHP_VERSION" ]]; then popd fi if [[ -n "$TRAVIS_PYTHON_VERSION" ]]; then - pyenv local $TRAVIS_PYTHON_VERSION pushd python_apps/airtime_analyzer nosetests popd From dd75cb1074780e4dc75bbce96660d8a5e61a0a00 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Fri, 20 Nov 2020 17:34:47 -0500 Subject: [PATCH 16/16] Tailoring testing to Xenial --- .travis.yml | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4196b0f19..6bf9c2f50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,24 +37,24 @@ addons: jobs: include: - - language: php - php: 7.3 - stage: test - - language: php - php: 7.2 - stage: test +# - language: php +# php: 7.3 +# stage: test +# - language: php +# php: 7.2 +# stage: test - language: php php: 7.0 stage: test - language: php php: 5.6 stage: test - - language: python - python: 3.8 - stage: test - - language: python - python: 3.6 - stage: test +# - language: python +# python: 3.8 +# stage: test +# - language: python +# python: 3.6 +# stage: test - language: python python: 3.5 stage: test @@ -74,16 +74,18 @@ jobs: tags: true allow_failures: # https://github.com/LibreTime/libretime/issues/779 - - language: php - php: 7.3 - - language: php - php: 7.2 +# - language: php +# php: 7.3 +# - language: php +# php: 7.2 # Ubuntu Bionic cloud image uses Python 3.6.9 - - language: python - python: 3.8 +# - language: python +# python: 3.8 # https://github.com/LibreTime/libretime/issues/1041 - - language: python - python: 3.5 +# - language: python +# python: 3.5 + - language: php + php: 5.6 install: ./travis/install.sh before_script: