Permalink
Browse files

Merge pull request #1501 from realityking/tests

Improve test coverage some more.
  • Loading branch information...
2 parents 26f3b0e + 5f1a4de commit 1d62cf3edfd3a0d76742e7bf99f3a153ecffa7cc @ianmacl ianmacl committed Aug 29, 2012
@@ -542,35 +542,6 @@ private function _getFileData($key)
}
/**
- * Converts a UNIX timestamp to a 4-byte DOS date and time format
- * (date in high 2-bytes, time in low 2-bytes allowing magnitude
- * comparison).
- *
- * @param integer $unixtime The current UNIX timestamp.
- *
- * @return integer The current date in a 4-byte DOS format.
- *
- * @since 11.1
- */
- private function _unix2DOSTime($unixtime = null)
- {
- $timearray = (is_null($unixtime)) ? getdate() : getdate($unixtime);
-
- if ($timearray['year'] < 1980)
- {
- $timearray['year'] = 1980;
- $timearray['mon'] = 1;
- $timearray['mday'] = 1;
- $timearray['hours'] = 0;
- $timearray['minutes'] = 0;
- $timearray['seconds'] = 0;
- }
-
- return (($timearray['year'] - 1980) << 25) | ($timearray['mon'] << 21) | ($timearray['mday'] << 16) | ($timearray['hours'] << 11) |
- ($timearray['minutes'] << 5) | ($timearray['seconds'] >> 1);
- }
-
- /**
* Adds a "file" to the ZIP archive.
*
* @param array &$file File data array to add
@@ -47,6 +47,39 @@ public function test__constructString()
}
/**
+ * Tests the JAccessRules::getData method.
+ *
+ * @return void
+ *
+ * @since 12.2
+ * @covers JAccessRules::getData
+ */
+ public function testGetData()
+ {
+ $array = array(
+ 'edit' => array(
+ -42 => 1,
+ 2 => 1,
+ 3 => 0
+ )
+ );
+
+ $rule = new JAccessRules($array);
+
+ $data = $rule->getData();
+
+ $this->assertArrayHasKey(
+ 'edit',
+ $data
+ );
+
+ $this->assertInstanceOf(
+ 'JAccessRule',
+ $data['edit']
+ );
+ }
+
+ /**
* @covers JAccessRules::__construct
* @covers JAccessRules::__toString
*/
@@ -74,6 +74,7 @@ public function testExtract()
* @group JArchive
* @return void
* @covers JArchiveGzip::extract
+ * @covers JArchiveGzip::_getFilePosition
*/
public function testExtractWithStreams()
{
@@ -49,6 +49,7 @@ protected function tearDown()
* @group JArchive
* @return void
* @covers JArchiveTar::extract
+ * @covers JArchiveTar::_getTarInfo
*/
public function testExtract()
{
@@ -88,6 +88,8 @@ public function testExtractNative()
* @group JArchive
* @return void
* @covers JArchiveZip::extractCustom
+ * @covers JArchiveZip::_readZipInfo
+ * @covers JArchiveZip::_getFileData
*/
public function testExtractCustom()
{
@@ -7,9 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM.'/joomla/log/log.php';
-require_once JPATH_PLATFORM.'/joomla/log/entry.php';
-
/**
* Test class for JLogEntry.
*/
@@ -19,6 +16,7 @@ class JLogEntryTest extends PHPUnit_Framework_TestCase
* Verify the default values for the log entry object.
*
* Test the JLogEntry::__construct method.
+ * @covers JLogEntry::__construct
*/
public function testDefaultValues()
{
@@ -58,6 +56,7 @@ public function testDefaultValues()
* Verify the priority for the entry object cannot be something not in the approved list.
*
* Test the JLogEntry::__construct method.
+ * @covers JLogEntry::__construct
*/
public function testBadPriorityValues()
{
@@ -87,6 +86,7 @@ public function testBadPriorityValues()
* Test that non-standard category values are sanitized.
*
* Test the JLogEntry::__construct method.
+ * @covers JLogEntry::__construct
*/
public function testCategorySanitization()
{
@@ -43,6 +43,7 @@ public function tearDown()
/**
* Test the JLogLoggerMessageQueue::addEntry method.
+ * @covers JLogLoggerMessageQueue::addEntry
*/
public function testAddEntry01()
{
@@ -7,8 +7,6 @@
* @license GNU General Public License version 2 or later; see LICENSE
*/
-require_once JPATH_PLATFORM . '/joomla/string/inflector.php';
-
/**
* Test for the JStringInflector class.
*
@@ -102,6 +100,7 @@ public function setUp()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::_addRule
*/
public function test_addRule()
{
@@ -152,6 +151,7 @@ public function test_addRule()
*
* @since 12.1
* @expectedException InvalidArgumentException
+ * @covers JStringInflector::_addRule
*/
public function test_addRuleException()
{
@@ -164,6 +164,7 @@ public function test_addRuleException()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::_getCachedPlural
*/
public function test_getCachedPlural()
{
@@ -189,6 +190,7 @@ public function test_getCachedPlural()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::_getCachedSingular
*/
public function test_getCachedSingular()
{
@@ -214,6 +216,7 @@ public function test_getCachedSingular()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::_matchRegexRule
*/
public function test_matchRegexRule()
{
@@ -242,6 +245,7 @@ public function test_matchRegexRule()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::_setCache
*/
public function test_setCache()
{
@@ -272,6 +276,7 @@ public function test_setCache()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::addCountableRule
*/
public function testAddCountableRule()
{
@@ -304,6 +309,7 @@ public function testAddCountableRule()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::addPluraliseRule
*/
public function testAddPluraliseRule()
{
@@ -330,6 +336,7 @@ public function testAddPluraliseRule()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::addSingulariseRule
*/
public function testAddSingulariseRule()
{
@@ -356,6 +363,7 @@ public function testAddSingulariseRule()
* @return void
*
* @since 12.1
+ * @covers JStringInflector::getInstance
*/
public function testGetInstance()
{
@@ -391,6 +399,7 @@ public function testGetInstance()
*
* @dataProvider seedIsCountable
* @since 12.1
+ * @covers JStringInflector::isCountable
*/
public function testIsCountable($input, $expected)
{
@@ -410,6 +419,7 @@ public function testIsCountable($input, $expected)
*
* @dataProvider seedSinglePlural
* @since 12.1
+ * @covers JStringInflector::isPlural
*/
public function testIsPlural($singular, $plural)
{
@@ -439,6 +449,7 @@ public function testIsPlural($singular, $plural)
*
* @dataProvider seedSinglePlural
* @since 12.1
+ * @covers JStringInflector::isSingular
*/
public function testIsSingular($singular, $plural)
{
@@ -468,6 +479,7 @@ public function testIsSingular($singular, $plural)
*
* @dataProvider seedSinglePlural
* @since 12.1
+ * @covers JStringInflector::toPlural
*/
public function testToPlural($singular, $plural)
{
@@ -487,6 +499,7 @@ public function testToPlural($singular, $plural)
*
* @dataProvider seedSinglePlural
* @since 12.1
+ * @covers JStringInflector::toSingular
*/
public function testToSingular($singular, $plural)
{
Oops, something went wrong.

0 comments on commit 1d62cf3

Please sign in to comment.