Format code using php-cs-fixer

This commit is contained in:
jo 2021-10-11 16:10:47 +02:00
parent 43d7dc92cd
commit d52c6184b9
352 changed files with 17473 additions and 17041 deletions

View file

@ -1,9 +1,13 @@
<?php
//require_once "../application/configs/conf.php";
/**
* @internal
* @coversNothing
*/
class BlockDbTest extends Zend_Test_PHPUnit_DatabaseTestCase //PHPUnit_Framework_TestCase
{
private $_connectionMock;
public function setUp()
@ -13,7 +17,6 @@ class BlockDbTest extends Zend_Test_PHPUnit_DatabaseTestCase //PHPUnit_Framework
parent::setUp();
}
public function getConnection()
{
if ($this->_connectionMock == null) {
@ -27,29 +30,26 @@ class BlockDbTest extends Zend_Test_PHPUnit_DatabaseTestCase //PHPUnit_Framework
);
Zend_Db_Table_Abstract::setDefaultAdapter($connection);
}
return $this->_connectionMock;
}
/**
* Load a dataset into the database for the block database tests
* 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;
return new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/seed_files.yml');
}
/**
* Test if the single newest file is added to the Database
*
* Test if the single newest file is added to the Database.
*/
public function testGetListofFilesMeetCriteriaSingleMatch() {
public function testGetListofFilesMeetCriteriaSingleMatch()
{
TestHelper::loginUser();
$CC_CONFIG = Config::getConfig();
$testqry = CcFilesQuery::create();
@ -67,13 +67,11 @@ class BlockDbTest extends Zend_Test_PHPUnit_DatabaseTestCase //PHPUnit_Framework
// need to load a example criteria into the database
}
/**
* Test if the single newest file is added to the Database
*
* Test if the single newest file is added to the Database.
*/
public function testMultiTrackandAlbumsGetLoaded() {
public function testMultiTrackandAlbumsGetLoaded()
{
TestHelper::loginUser();
$CC_CONFIG = Config::getConfig();
$testqry = CcFilesQuery::create();
@ -91,5 +89,4 @@ class BlockDbTest extends Zend_Test_PHPUnit_DatabaseTestCase //PHPUnit_Framework
// add assertion that the length is less than 1 hour...
// need to load a example criteria into the database
}
}
}

View file

@ -1,6 +1,11 @@
<?php
require_once "../application/configs/conf.php";
require_once '../application/configs/conf.php';
/**
* @internal
* @coversNothing
*/
class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
{
private $_connectionMock;
@ -16,7 +21,7 @@ class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
public function appBootstrap()
{
$this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH .'/configs/application.ini');
$this->application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
$this->application->bootstrap();
}
@ -33,6 +38,7 @@ class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
);
Zend_Db_Table_Abstract::setDefaultAdapter($connection);
}
return $this->_connectionMock;
}
@ -53,7 +59,7 @@ class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$data = ShowServiceData::getOverlappingShowCheckTestData();
$showService = new Application_Service_ShowService(null, $data);
/** Create shows to test against **/
// Create shows to test against
$showService->addUpdateShow($data);
$ds = new Zend_Test_PHPUnit_Db_DataSet_QueryDataSet(
@ -65,49 +71,49 @@ class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$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 **/
// Make sure shows were created correctly
$this->assertDataSetsEqual(
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . "/datasets/test_checkOverlappingShows.yml"),
new PHPUnit_Extensions_Database_DataSet_YamlDataSet(__DIR__ . '/datasets/test_checkOverlappingShows.yml'),
$ds
);
$utcTimezone = new DateTimeZone("UTC");
$utcTimezone = new DateTimeZone('UTC');
/** Test that overlapping check works when creating a new show **/
/** 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)
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)
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)
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)
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)
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 **/
/** 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),
new DateTime('2014-01-05 00:00:00', $utcTimezone),
new DateTime('2014-01-05 02:00:00', $utcTimezone),
true,
null,
1
@ -115,24 +121,24 @@ class ScheduleDbTest extends Zend_Test_PHPUnit_DatabaseTestCase
$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 **/
* 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";
$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),
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);
}
}
}