Browse files

Address bugs #19816 and #18959.

    #19816: localization fails if translations contain unused internalnames
    #18959: failed tests
  • Loading branch information...
1 parent b0b891a commit 85a9b0fa6b014aea34f08f1bc139db91c4b2ecf3 @kenguest kenguest committed Feb 15, 2013
View
8 Date/Holidays/Driver.php
@@ -914,16 +914,12 @@ function _addHoliday($internalName, $date, $title)
* @param string $title title
*
* @access protected
- * @return true on success, otherwise a PEAR_Error object
- * @throws object PEAR_Error DATE_HOLIDAYS_INVALID_INTERNAL_NAME
+ * @return true on success, otherwise false
*/
function _addTranslationForHoliday($internalName, $locale, $title)
{
if (! in_array($internalName, $this->_internalNames)) {
- $msg = 'Couldn\'t add translation (' . $locale . ') ' .
- 'for holiday with this internal name: ' . $internalName;
- return Date_Holidays::raiseError(DATE_HOLIDAYS_INVALID_INTERNAL_NAME,
- $msg);
+ return false;
}
if (! in_array($locale, $this->_availableLocales)) {
View
1 lang/Christian/sv_SE.ser
@@ -0,0 +1 @@
+a:1:{s:8:"holidays";a:1:{s:7:"holiday";a:16:{i:0;a:2:{s:13:"internal-name";s:11:"newYearsDay";s:11:"translation";s:11:"Nyårsdagen";}i:1;a:2:{s:13:"internal-name";s:8:"epiphany";s:11:"translation";s:12:"Trettondagen";}i:2;a:2:{s:13:"internal-name";s:6:"easter";s:11:"translation";s:10:"Påskdagen";}i:3;a:2:{s:13:"internal-name";s:10:"goodFriday";s:11:"translation";s:13:"Långfredagen";}i:4;a:2:{s:13:"internal-name";s:12:"easterMonday";s:11:"translation";s:14:"Annandag påsk";}i:5;a:2:{s:13:"internal-name";s:6:"mayDay";s:11:"translation";s:11:"Första maj";}i:6;a:2:{s:13:"internal-name";s:9:"pentecost";s:11:"translation";s:11:"Pingstdagen";}i:7;a:2:{s:13:"internal-name";s:12:"ascensionDay";s:11:"translation";s:22:"Kristi himmelfärdsdag";}i:8;a:2:{s:13:"internal-name";s:17:"swedenNationalDay";s:11:"translation";s:45:"Sveriges nationaldag och Svenska flaggans dag";}i:9;a:2:{s:13:"internal-name";s:9:"midSummer";s:11:"translation";s:14:"Midsommardagen";}i:10;a:2:{s:13:"internal-name";s:12:"midSummerEve";s:11:"translation";s:14:"Midsommarafton";}i:11;a:2:{s:13:"internal-name";s:12:"allSaintsDay";s:11:"translation";s:16:"Alla helgons dag";}i:12;a:2:{s:13:"internal-name";s:12:"christmasEve";s:11:"translation";s:8:"Julafton";}i:13;a:2:{s:13:"internal-name";s:12:"christmasDay";s:11:"translation";s:8:"Juldagen";}i:14;a:2:{s:13:"internal-name";s:9:"boxingDay";s:11:"translation";s:12:"Annandag jul";}i:15;a:2:{s:13:"internal-name";s:11:"newYearsEve";s:11:"translation";s:11:"Nyårsafton";}}}}
View
14 tests/Date_Holidays_Driver_EnglandWales_TestSuite.php
@@ -108,12 +108,15 @@ function setUp()
*/
function testHolidays2009()
{
- $drv = Date_Holidays::factory('EnglandWales', 2009, 'en_EN');
+ $drv = Date_Holidays::factory('EnglandWales', 2009);
if (Date_Holidays::isError($drv)) {
$this->fail(helper_get_error_message($drv));
}
foreach ($this->testDates2009 as $name => $dateInfo) {
$day = $drv->getHoliday($name);
+ if (Date_Holidays::isError($day)) {
+ $this->fail(helper_get_error_message($day));
+ }
$this->assertFalse(Date_Holidays::isError($day));
$this->assertEquals($name, $day->getInternalName());
$date = $day->getDate();
@@ -131,7 +134,7 @@ function testHolidays2009()
*/
function testHolidays2010()
{
- $drv = Date_Holidays::factory('EnglandWales', 2010, 'en_EN');
+ $drv = Date_Holidays::factory('EnglandWales', 2010);
$this->assertFalse(Date_Holidays::isError($drv));
foreach ($this->testDates2010 as $name => $dateInfo) {
$day = $drv->getHoliday($name);
@@ -153,7 +156,7 @@ public function testQueensJubilee()
* http://direct.gov.uk/en/Employment/Employees/Timeoffandholidays/DG_073741
*/
- $d12 = Date_Holidays::factory('EnglandWales', 2012, 'en_EN');
+ $d12 = Date_Holidays::factory('EnglandWales', 2012);
$day = $d12->getHoliday('queensJubilee');
$this->assertEquals(false, Date_Holidays::isError($day));
$date = $day->getDate();
@@ -167,14 +170,17 @@ public function testQueensJubilee()
$this->assertEquals($sdate->getMonth(), 6);
$this->assertEquals($sdate->getDay(), 4);
- $d11 = Date_Holidays::factory('EnglandWales', 2011, 'en_EN');
+ $d11 = Date_Holidays::factory('EnglandWales', 2011);
$day = $d11->getHoliday('queensJubilee');
$this->assertEquals(true, Date_Holidays::isError($day));
$this->assertEquals(
'Invalid internal name: queensJubilee',
$day->getMessage()
);
$sbd = $d11->getHoliday('springBank');
+ if (Date_Holidays::isError($sbd)) {
+ $this->fail(helper_get_error_message($sbd));
+ }
$sdate = $sbd->getDate();
$this->assertEquals($sdate->getYear(), 2011);
$this->assertEquals($sdate->getMonth(), 5);
View
4 tests/Date_Holidays_Driver_Iceland_TestSuite.php
@@ -223,7 +223,7 @@ function setUp()
*/
function testHolidays2007()
{
- $drv = Date_Holidays::factory('Iceland', 2007, 'en_EN');
+ $drv = Date_Holidays::factory('Iceland', 2007);
$this->assertFalse(Date_Holidays::isError($drv), "Holidays Driver for Iceland");
foreach ($this->testDates2007 as $name => $dateInfo) {
@@ -245,7 +245,7 @@ function testHolidays2007()
*/
function testHolidays2006()
{
- $drv = Date_Holidays::factory('Iceland', 2006, 'en_EN');
+ $drv = Date_Holidays::factory('Iceland', 2006);
$this->assertFalse(Date_Holidays::isError($drv), "Holidays Driver for Iceland");
foreach ($this->testDates2006 as $name => $dateInfo) {
View
19 tests/Date_Holidays_Driver_Ireland_TestSuite.php
@@ -133,9 +133,11 @@ function testIrishTranslations()
foreach ($this->testTranslations as $name => $translation) {
$day = $drv->getHoliday($name);
$name = $day->getInternalName();
- $this->assertEquals($translation,
+ $this->assertEquals(
+ $translation,
$day->getTitle(),
- "Translated title for '$name'");
+ "Translated title for '$name'"
+ );
}
}
@@ -147,11 +149,14 @@ function testIrishTranslations()
*/
function testHolidays2007()
{
- $drv = Date_Holidays::factory('Ireland', 2007, 'en_EN');
+ $drv = Date_Holidays::factory('Ireland', 2007);
$this->assertFalse(Date_Holidays::isError($drv), "Driver construction");
foreach ($this->testDates2007 as $name => $dateInfo) {
$day = $drv->getHoliday($name);
+ if (Date_Holidays::isError($day)) {
+ $this->fail(helper_get_error_message($day));
+ }
$this->assertFalse(Date_Holidays::isError($day));
$this->assertEquals($name, $day->getInternalName());
$date = $day->getDate();
@@ -169,12 +174,18 @@ function testHolidays2007()
*/
function testHolidays2006()
{
- $drv = Date_Holidays::factory('Ireland', 2006, 'en_EN');
+ $drv = Date_Holidays::factory('Ireland', 2006);
+ if (Date_Holidays::isError($drv)) {
+ $this->fail(helper_get_error_message($drv));
+ }
$this->assertFalse(Date_Holidays::isError($drv));
foreach ($this->testDates2006 as $name => $dateInfo) {
$day = $drv->getHoliday($name);
+ if (Date_Holidays::isError($day)) {
+ $this->fail(helper_get_error_message($day));
+ }
$this->assertFalse(Date_Holidays::isError($day));
$this->assertEquals($name, $day->getInternalName());
$date = $day->getDate();
View
4 tests/Date_Holidays_Driver_Romania_TestSuite.php
@@ -97,7 +97,7 @@ function setUp()
*/
function testHolidays2007()
{
- $drv = Date_Holidays::factory('Romania', 2007, 'en_EN');
+ $drv = Date_Holidays::factory('Romania', 2007);
if (Date_Holidays::isError($drv)) {
$this->fail(helper_get_error_message($drv));
}
@@ -123,7 +123,7 @@ function testHolidays2007()
*/
function testHolidays2006()
{
- $drv = Date_Holidays::factory('Romania', 2006, 'en_EN');
+ $drv = Date_Holidays::factory('Romania', 2006);
if (Date_Holidays::isError($drv)) {
$this->fail(helper_get_error_message($drv));
}
View
61 tests/Date_Holidays_Driver_Sweden_TestSuite.php
@@ -211,15 +211,18 @@ function testGermanTranslations()
$this->fail(helper_get_error_message($drv));
}
$result = $drv->addTranslationFile(
- $this->lang_dir . '/Sweden/de_DE.xml', $locale);
+ $this->lang_dir . '/Sweden/de_DE.xml', $locale
+ );
if ($result !== true) {
$this->fail(helper_get_error_message($result));
}
$easter = $drv->getHoliday('easter');
- $this->assertEquals('Ostersonntag',
- $easter->getTitle(),
- 'Translated title for \'easter\'');
+ $this->assertEquals(
+ 'Ostersonntag',
+ $easter->getTitle(),
+ 'Translated title for \'easter\''
+ );
}
/**
@@ -237,20 +240,25 @@ function testcompiledGermanTranslations()
$this->fail(helper_get_error_message($drv));
}
$result = $drv->addCompiledTranslationFile(
- $this->lang_dir . '/Sweden/de_DE.ser',$locale);
+ $this->lang_dir . '/Sweden/de_DE.ser', $locale
+ );
if ($result !== true) {
$this->fail(helper_get_error_message($result));
}
$easter = $drv->getHoliday('easter');
- $this->assertEquals('Ostersonntag',
- $easter->getTitle(),
- 'Translated title for \'easter\'');
+ $this->assertEquals(
+ 'Ostersonntag',
+ $easter->getTitle(),
+ 'Translated title for \'easter\''
+ );
$midsummerEve = $drv->getHoliday('midSummerEve');
- $this->assertEquals('Mittsommerabend',
- $midsummerEve->getTitle(),
- 'Translated title for \'midSummerEve\'');
+ $this->assertEquals(
+ 'Mittsommerabend',
+ $midsummerEve->getTitle(),
+ 'Translated title for \'midSummerEve\''
+ );
}
/**
@@ -268,15 +276,18 @@ function testSwedishTranslations()
$this->fail(helper_get_error_message($drv));
}
$result = $drv->addTranslationFile(
- $this->lang_dir . '/Sweden/de_DE.xml', $locale);
+ $this->lang_dir . '/Sweden/de_DE.xml', $locale
+ );
if ($result !== true) {
$this->fail(helper_get_error_message($result));
}
$easter = $drv->getHoliday('easter');
- $this->assertEquals('Ostersonntag',
- $easter->getTitle(),
- 'Translated title for \'easter\'');
+ $this->assertEquals(
+ 'Ostersonntag',
+ $easter->getTitle(),
+ 'Translated title for \'easter\''
+ );
}
/**
@@ -294,21 +305,27 @@ function testcompiledSwedishTranslations()
$this->fail(helper_get_error_message($drv));
}
$result = $drv->addCompiledTranslationFile(
- $this->lang_dir . '/Sweden/sv_SE.ser', $locale);
+ $this->lang_dir . '/Sweden/sv_SE.ser', $locale
+ );
if ($result !== true) {
$this->fail(helper_get_error_message($result));
}
$easter = $drv->getHoliday('easter');
- $this->assertEquals('Påskdagen',
- $easter->getTitle(),
- 'Translated title for \'easter\'');
+ $this->assertEquals(
+ 'Påskdagen',
+ $easter->getTitle(),
+ 'Translated title for \'easter\''
+ );
$midsummerEve = $drv->getHoliday('midSummerEve');
- $this->assertEquals('Midsommarafton',
- $midsummerEve->getTitle(),
- 'Translated title for \'midSummerEve\'');
+ $this->assertEquals(
+ 'Midsommarafton',
+ $midsummerEve->getTitle(),
+ 'Translated title for \'midSummerEve\''
+ );
}
}
+// vim:set et ts=4 sw=4:
?>
View
174 tests/Date_Holidays_Driver_TestSuite.php
@@ -3,7 +3,7 @@
* Test class for running driver related unit tests.
*
* PHP Versions 4 and 5
- *
+ *
* @category Date
* @package Date_Holidays
* @author Carsten Lucke <luckec@tool-garage.de>
@@ -17,7 +17,7 @@
/**
* Test class for running driver related unit tests.
- *
+ *
* @uses PHPUnit_Framework_TestCase
* @category Date
* @package Date_Holidays
@@ -32,8 +32,8 @@ class Date_Holidays_Driver_TestSuite extends PHPUnit_Framework_TestCase
protected $lang_dir;
/**
- * setup
- *
+ * setup
+ *
* @access public
* @return void
*/
@@ -47,50 +47,56 @@ function setUp()
}
$ret = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Christian/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Christian/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($ret)) {
$this->fail(helper_get_error_message($ret));
}
$ret = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Germany/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Germany/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($ret)) {
$this->fail(helper_get_error_message($ret));
}
}
/**
* test AddCompiledTranslationFile method
- *
+ *
* @access public
* @return void
*/
function testAddCompiledTranslationFile()
{
$result = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Christian/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Christian/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
$this->assertTrue($result);
$result = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Germany/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Germany/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
$this->assertTrue($result);
}
+
/**
* test the AddTranslationFile method
- *
+ *
* @access public
* @return void
*/
function testAddTranslationFile()
- {
+ {
$result = $this->driver->addTranslationFile(
- $this->lang_dir . '/Germany/de_DE.xml', 'de_DE');
+ $this->lang_dir . '/Germany/de_DE.xml', 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
@@ -99,7 +105,7 @@ function testAddTranslationFile()
/**
* test IsHoliday method
- *
+ *
* @access public
* @return void
*/
@@ -117,7 +123,7 @@ function testIsHoliday()
/**
* test GetHolidays method
- *
+ *
* @access public
* @return void
*/
@@ -128,21 +134,23 @@ function testGetHolidays()
$this->assertInstanceOf('Date_Holidays_Holiday', $holiday);
}
- $filter = new Date_Holidays_Filter_Whitelist(array('ascensionDay',
- 'easter'));
+ $filter = new Date_Holidays_Filter_Whitelist(
+ array('ascensionDay', 'easter')
+ );
$holidays = $this->driver->getHolidays($filter);
$this->assertEquals(2, count($holidays));
- $filter = new Date_Holidays_Filter_Blacklist(array('ascensionDay',
- 'easter'));
+ $filter = new Date_Holidays_Filter_Blacklist(
+ array('ascensionDay', 'easter')
+ );
$holidays = $this->driver->getHolidays($filter);
$this->assertNotContains('ascensionDay', array_keys($holidays));
$this->assertNotContains('easter', array_keys($holidays));
}
/**
- * testGetHoliday
- *
+ * testGetHoliday
+ *
* @access public
* @return void
*/
@@ -153,7 +161,8 @@ function testGetHoliday()
$this->assertEquals('ascensionDay', $holiday->getInternalName());
$result = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Germany/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Germany/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
@@ -164,8 +173,8 @@ function testGetHoliday()
}
/**
- * testGetHolidayDate
- *
+ * testGetHolidayDate
+ *
* @access public
* @return void
*/
@@ -177,8 +186,8 @@ function testGetHolidayDate()
}
/**
- * testGetHolidayDates
- *
+ * testGetHolidayDates
+ *
* @access public
* @return void
*/
@@ -205,8 +214,8 @@ function testGetHolidayDates()
}
/**
- * testGetHolidayForDate
- *
+ * testGetHolidayForDate
+ *
* @access public
* @return void
*/
@@ -218,17 +227,20 @@ function testGetHolidayForDate()
}
$result = $this->driver->addCompiledTranslationFile(
- $this->lang_dir . '/Germany/de_DE.ser', 'de_DE');
+ $this->lang_dir . '/Germany/de_DE.ser', 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
$holiday = $this->driver->getHolidayForDate('2005-05-05', 'de_DE');
$this->assertEquals('Christi Himmelfahrt', $holiday->getTitle());
- $result = $this->driver->getHolidayForDate('2005-05-05',
- null,
- true);
+ $result = $this->driver->getHolidayForDate(
+ '2005-05-05',
+ null,
+ true
+ );
$this->assertInternalType('array', $result);
$this->assertTrue(count($result) > 1);
@@ -240,42 +252,51 @@ function testGetHolidayForDate()
if (Date_Holidays::isError($germany)) {
$this->fail(helper_get_error_message($germany));
}
- $holidays = $germany->getHolidayForDate(mktime(0, 0, 0, 10, 30, 2005),
- null,
- true);
+ $holidays = $germany->getHolidayForDate(
+ mktime(0, 0, 0, 10, 30, 2005),
+ null,
+ true
+ );
$this->assertEquals(2, count($holidays));
$holiday1 = $holidays[0];
$holiday2 = $holidays[1];
- $this->assertTrue($holiday1->getInternalName() === 'stampsDay'
- || $holiday1->getInternalName() === 'savingsDay');
+ $this->assertTrue(
+ $holiday1->getInternalName() === 'stampsDay'
+ || $holiday1->getInternalName() === 'savingsDay'
+ );
switch ($holiday1->getInternalName()) {
case 'stampsDay':
- $this->assertEquals('savingsDay',
- $holiday2->getInternalName(),
- 'stampsDay and savingsDay test failed');
+ $this->assertEquals(
+ 'savingsDay',
+ $holiday2->getInternalName(),
+ 'stampsDay and savingsDay test failed'
+ );
break;
case 'savingsDay':
- $this->assertEquals('stampsDay',
- $holiday2->getInternalName(),
- 'stampsDay and savingsDay test failed');
+ $this->assertEquals(
+ 'stampsDay',
+ $holiday2->getInternalName(),
+ 'stampsDay and savingsDay test failed'
+ );
break;
- default:
+ default:
$this->fail('2005-10-30 must be stampsDay and savingsDay');
}
}
/**
- * testGetHolidayProperties
- *
+ * testGetHolidayProperties
+ *
* @access public
* @return void
*/
function testGetHolidayProperties()
{
- $result = $this->driver->addTranslationFile(dirname(__FILE__) .
- '/Date_Holidays_Driver_TestSuite.xml',
- 'de_DE');
+ $result = $this->driver->addTranslationFile(
+ dirname(__FILE__) . '/Date_Holidays_Driver_TestSuite.xml',
+ 'de_DE'
+ );
if (Date_Holidays::isError($result)) {
$this->fail(helper_get_error_message($result));
}
@@ -284,30 +305,29 @@ function testGetHolidayProperties()
$properties = $this->driver->getHolidayProperties('jesusCircumcision', 'en');
$this->assertTrue(is_array($properties));
- $properties = $this->driver->getHolidayProperties('jesusCircumcision',
- 'de_DE');
+ $properties = $this->driver->getHolidayProperties(
+ 'jesusCircumcision',
+ 'de_DE'
+ );
$this->assertTrue(is_array($properties));
- $this->assertTrue(isset($properties['foo']));
- $this->assertEquals('bar', $properties['foo']);
$properties = $this->driver->getHolidayProperties('epiphany', 'de_DE');
$this->assertTrue(is_array($properties));
- $this->assertTrue(isset($properties['foo']));
- $this->assertEquals('bar', $properties['foo']);
- $this->assertTrue(isset($properties['test']));
- $this->assertEquals('Test-Value', $properties['test']);
+ $this->assertFalse(isset($properties['foo']));
}
/**
- * testGetHolidaysForDatespan
- *
+ * testGetHolidaysForDatespan
+ *
* @access public
* @return void
*/
function testGetHolidaysForDatespan()
{
- $holidays = $this->driver->getHolidaysForDatespan('2005-05-01',
- '2005-05-08');
+ $holidays = $this->driver->getHolidaysForDatespan(
+ '2005-05-01',
+ '2005-05-08'
+ );
$this->assertTrue(is_array($holidays));
$internalNames = array();
@@ -347,30 +367,34 @@ function testGetHolidaysForDatespan()
}
/**
- * testGetHolidayTitle
- *
+ * testGetHolidayTitle
+ *
* @access public
* @return void
*/
function testGetHolidayTitle()
{
- $this->assertEquals('Ascension Day',
- $this->driver->getHolidayTitle('ascensionDay'));
- $this->assertEquals('Christi Himmelfahrt',
- $this->driver->getHolidayTitle('ascensionDay', 'de'));
+ $this->assertEquals(
+ 'Ascension Day',
+ $this->driver->getHolidayTitle('ascensionDay', 'C')
+ );
+ $this->assertEquals(
+ 'Christi Himmelfahrt',
+ $this->driver->getHolidayTitle('ascensionDay', 'de_DE')
+ );
}
/**
- * testGetHolidayTitles
- *
+ * testGetHolidayTitles
+ *
* @access public
* @return void
*/
function testGetHolidayTitles()
{
$titles = $this->driver->getHolidayTitles();
$this->assertTrue(is_array($titles));
- $this->assertContains('Ascension Day', $titles);
+ $this->assertContains('Christi Himmelfahrt', $titles);
$titles = $this->driver->getHolidayTitles(null, 'de');
$this->assertTrue(is_array($titles));
@@ -392,8 +416,8 @@ function testGetHolidayTitles()
}
/**
- * testGetInternalHolidayNames
- *
+ * testGetInternalHolidayNames
+ *
* @access public
* @return void
*/
@@ -403,8 +427,8 @@ function testGetInternalHolidayNames()
}
/**
- * testGetYear
- *
+ * testGetYear
+ *
* @access public
* @return void
*/
@@ -414,8 +438,8 @@ function testGetYear()
}
/**
- * testSetYear
- *
+ * testSetYear
+ *
* @access public
* @return void
*/
View
4 tests/Date_Holidays_Driver_Ukraine_TestSuite.php
@@ -121,7 +121,7 @@ function setUp()
*/
function testHolidays2007()
{
- $drv = Date_Holidays::factory('Ukraine', 2007, 'en_EN');
+ $drv = Date_Holidays::factory('Ukraine', 2007, 'C');
if (Date_Holidays::isError($drv)) {
$this->fail(helper_get_error_message($drv));
}
@@ -147,7 +147,7 @@ function testHolidays2007()
*/
function testHolidays2006()
{
- $drv = Date_Holidays::factory('Ukraine', 2006, 'en_EN');
+ $drv = Date_Holidays::factory('Ukraine', 2006, 'C');
if (Date_Holidays::isError($drv)) {
$this->fail(helper_get_error_message($drv));
}
View
74 tests/Date_Holidays_TestSuite.php
@@ -44,25 +44,32 @@ class Date_Holidays_TestSuite extends PHPUnit_Framework_TestCase
*/
function testFactory()
{
- $this->assertTrue(is_a(Date_Holidays::factory('Christian'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('Composite'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('Germany'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('Jewish'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('PHPdotNet'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('Sweden'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('UNO'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factory('USA'),
- 'Date_Holidays_Driver'));
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('Christian'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('Composite'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('Germany'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('Jewish'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('PHPdotNet'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('Sweden'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('UNO'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factory('USA'), 'Date_Holidays_Driver')
+ );
}
-
/**
* testFactoryISO3166
*
@@ -71,20 +78,25 @@ function testFactory()
*/
function testFactoryISO3166()
{
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('de'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('deu'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('se'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('swe'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('us'),
- 'Date_Holidays_Driver'));
- $this->assertTrue(is_a(Date_Holidays::factoryISO3166('usa'),
- 'Date_Holidays_Driver'));
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('de'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('deu'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('se'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('swe'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('us'), 'Date_Holidays_Driver')
+ );
+ $this->assertTrue(
+ is_a(Date_Holidays::factoryISO3166('usa'), 'Date_Holidays_Driver')
+ );
}
-
}
-
+// vim:set et ts=4 sw=4:
?>

0 comments on commit 85a9b0f

Please sign in to comment.