Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

This commit fixes few unit test cases.

  • Loading branch information...
commit a60dceec0242f3b47a01733c363d7211c4c14956 1 parent 92c73ab
Nilesh Patkar authored
View
3  app/protected/extensions/zurmoinc/framework/adapters/dataproviders/SearchDataProviderMetadataAdapter.php
@@ -192,8 +192,7 @@ protected function populateClausesAndStructureForAttribute( $attributeName,
{
if ($this->model->isRelation($attributeName))
{
-
- if($this->model->$attributeName instanceof RedBeanOneToManyRelatedModels ||
+ if ($this->model->$attributeName instanceof RedBeanOneToManyRelatedModels ||
$this->model->$attributeName instanceof RedBeanManyToManyRelatedModels)
{
$relationModelClassName = $this->model->getRelationModelClassName($attributeName);
View
6 app/protected/extensions/zurmoinc/framework/tests/unit/TestCustomFieldsModelTest.php
@@ -36,7 +36,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('MultipleSomethings');
$customFieldData->serializedData = serialize($multiSelectValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
$tagCloudValues = array(
'Cloud 1',
@@ -45,7 +46,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('TagCloud');
$customFieldData->serializedData = serialize($tagCloudValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
}
public function testMultiSelectAndTagCloudRelationships()
View
2  app/protected/extensions/zurmoinc/framework/utils/SearchFormAttributesToSearchDataProviderMetadataUtil.php
@@ -140,7 +140,7 @@ protected static function resolveMetadataForResolveEntireMappingByRules($model,
$className::resolveAttributesAndRelations($attributeName, $newAttributesAndRelations, $value);
unset($metadata[$attributeName][$index]);
- foreach($newAttributesAndRelations as $newAttributesAndRelationsItem)
+ foreach ($newAttributesAndRelations as $newAttributesAndRelationsItem)
{
$newAttributesAndRelationsItem[0] = $attributesAndRelations[0];
$newAttributesAndRelationsItem[1] = $attributesAndRelations[1];
View
2  app/protected/extensions/zurmoinc/framework/widgets/ExtendedGridView.php
@@ -133,7 +133,7 @@ protected function renderMassActionDropDownElement()
{
url : $.fn.yiiGridView.getUrl('" . $this->id . "')
}
- if(options.url.split( '?' ).length == 2)
+ if (options.url.split( '?' ).length == 2)
{
options.url.split( '?' )[0];
options.url = options.url.split( '?' )[0] +'/'+ $(this).val() + '?' + options.url.split( '?' )[1];
View
6 app/protected/modules/api/tests/unit/ApiRestTestModelItemTest.php
@@ -39,7 +39,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('ApiTestMultiDropDown');
$customFieldData->serializedData = serialize($multiSelectValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
$tagCloudValues = array(
'Cloud 1',
@@ -48,7 +49,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('ApiTestTagCloud');
$customFieldData->serializedData = serialize($tagCloudValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
}
public function testApiServerUrl()
View
10 app/protected/modules/api/tests/unit/RedBeanModelToApiDataUtilTest.php
@@ -42,7 +42,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('ApiTestMultiDropDown');
$customFieldData->serializedData = serialize($multiSelectValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
$tagCloudValues = array(
'Cloud 1',
@@ -51,7 +52,8 @@ public static function setUpBeforeClass()
);
$customFieldData = CustomFieldData::getByName('ApiTestTagCloud');
$customFieldData->serializedData = serialize($tagCloudValues);
- assert($customFieldData->save()); // Not Coding Standard
+ $save = $customFieldData->save();
+ assert('$save'); // Not Coding Standard
}
public function setUp()
@@ -232,6 +234,8 @@ public function testGetDataWithAllHasOneOrOwnedRelationsSet()
'value' => $values[1],
),
'radioDropDown' => null,
+ 'multiDropDown' => array('values' => null),
+ 'tagCloud' => array('values' => null),
'hasOne' => null,
'hasOneAlso' => null,
'primaryEmail' => null,
@@ -251,8 +255,6 @@ public function testGetDataWithAllHasOneOrOwnedRelationsSet()
'id' => $super->id,
'username' => 'super'
),
- 'multiDropDown' => array('values' => null),
- 'tagCloud' => array('values' => null),
);
$this->assertEquals($compareData, $data);
}
View
55 app/protected/modules/install/utils/InstallUtil.php
@@ -245,30 +245,30 @@ public static function checkCtype()
*/
public static function checkServerVariable(&$error)
{
- $vars=array('HTTP_HOST','SERVER_NAME','SERVER_PORT','SCRIPT_NAME','SCRIPT_FILENAME','PHP_SELF','HTTP_ACCEPT','HTTP_USER_AGENT');
- $missing=array();
- foreach($vars as $var)
+ $vars = array('HTTP_HOST', 'SERVER_NAME', 'SERVER_PORT', 'SCRIPT_NAME', 'SCRIPT_FILENAME', 'PHP_SELF', 'HTTP_ACCEPT', 'HTTP_USER_AGENT');
+ $missing = array();
+ foreach ($vars as $var)
{
- if(!isset($_SERVER[$var]))
+ if (!isset($_SERVER[$var]))
{
- $missing[]=$var;
+ $missing[] = $var;
}
}
- if(!empty($missing))
+ if (!empty($missing))
{
- $error = Yii::t('Default','$_SERVER does not have {vars}.',array('{vars}'=>implode(', ',$missing)));
+ $error = Yii::t('Default', '$_SERVER does not have {vars}.', array('{vars}' => implode(', ', $missing)));
return false;
}
- if(!isset($_SERVER["REQUEST_URI"]) && isset($_SERVER["QUERY_STRING"]))
+ if (!isset($_SERVER["REQUEST_URI"]) && isset($_SERVER["QUERY_STRING"]))
{
- $error = Yii::t('Default','Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.');
+ $error = Yii::t('Default', 'Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must exist.');
return false;
}
- if(!isset($_SERVER["PATH_INFO"]) && strpos($_SERVER["PHP_SELF"],$_SERVER["SCRIPT_NAME"]) !== 0)
+ if (!isset($_SERVER["PATH_INFO"]) && strpos($_SERVER["PHP_SELF"], $_SERVER["SCRIPT_NAME"]) !== 0)
{
- $error = Yii::t('Default','Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.');
+ $error = Yii::t('Default', 'Unable to determine URL path info. Please make sure $_SERVER["PATH_INFO"] (or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"]) contains proper value.');
return false;
}
return true;
@@ -421,17 +421,16 @@ public static function checkDatabaseThreadStackValue($databaseType,
* Check database optimizer_search_depth value.
*/
public static function checkDatabaseOptimizerSearchDepthValue($databaseType,
- $databaseHostname,
- $databaseUsername,
- $databasePassword,
- /* out */ & $optimizerSearchDepth)
+ $databaseHostname,
+ $databaseUsername,
+ $databasePassword,
+ /* out */ & $optimizerSearchDepth)
{
assert('in_array($databaseType, self::getSupportedDatabaseTypes())');
- $optimizerSearchDepth = DatabaseCompatibilityUtil::getDatabaseOptimizerSearchDepthValue(
- $databaseType,
- $databaseHostname,
- $databaseUsername,
- $databasePassword);
+ $optimizerSearchDepth = DatabaseCompatibilityUtil::getDatabaseOptimizerSearchDepthValue($databaseType,
+ $databaseHostname,
+ $databaseUsername,
+ $databasePassword);
return $optimizerSearchDepth == 0;
}
@@ -439,12 +438,12 @@ public static function checkDatabaseOptimizerSearchDepthValue($databaseType,
* Check database default collation.
*/
public static function checkDatabaseDefaultCollation($databaseType,
- $databaseHostname,
- $databaseName,
- $databaseUsername,
- $databasePassword,
- $notAllowedDatabaseCollations,
- /* out */ & $databaseDefaultCollation)
+ $databaseHostname,
+ $databaseName,
+ $databaseUsername,
+ $databasePassword,
+ $notAllowedDatabaseCollations,
+ /* out */ & $databaseDefaultCollation)
{
assert('in_array($databaseType, self::getSupportedDatabaseTypes())');
assert('is_array($notAllowedDatabaseCollations)');
@@ -619,10 +618,10 @@ public static function writeConfiguration($instanceRoot,
assert('is_string($scriptUrl) || $scriptUrl == ""');
$perInstanceConfigFileDist = "$instanceRoot/protected/config/perInstanceDIST.php";
- $debugConfigFileDist = "$instanceRoot/protected/config/debugDIST.php";
+ $debugConfigFileDist = "$instanceRoot/protected/config/debugDIST.php";
$perInstanceConfigFile = "$instanceRoot/protected/config/$perInstanceFilename";
- $debugConfigFile = "$instanceRoot/protected/config/$debugFilename";
+ $debugConfigFile = "$instanceRoot/protected/config/$debugFilename";
copy($perInstanceConfigFileDist, $perInstanceConfigFile);
copy($debugConfigFileDist, $debugConfigFile);
View
8 app/protected/modules/maps/tests/unit/GoogleMappingUtilTest.php
@@ -97,8 +97,8 @@ public function testGeoCodeResultData()
$this->assertEquals(0, $account1->billingAddress->invalid);
$account2 = Account::getById($accountId2);
- $this->assertEquals('37.4211444', $account2->billingAddress->latitude);
- $this->assertEquals('-122.0853032', $account2->billingAddress->longitude);
+ $this->assertEquals('37.4220761', $account2->billingAddress->latitude);
+ $this->assertEquals('-122.0845187', $account2->billingAddress->longitude);
$this->assertEquals(0, $account1->billingAddress->invalid);
$account3 = Account::getById($accountId3);
@@ -140,8 +140,8 @@ public function testGeoCodeResultData()
$this->assertEquals('42.1153153', $geoCodeResultObj1->latitude);
$this->assertEquals('-87.9763703', $geoCodeResultObj1->longitude);
- $this->assertEquals('37.4211444', $geoCodeResultObj2->latitude);
- $this->assertEquals('-122.0853032', $geoCodeResultObj2->longitude);
+ $this->assertEquals('37.4220761', $geoCodeResultObj2->latitude);
+ $this->assertEquals('-122.0845187', $geoCodeResultObj2->longitude);
$this->assertEquals('40.7274969', $geoCodeResultObj3->latitude);
$this->assertEquals('-73.9601597', $geoCodeResultObj3->longitude);
$this->assertEquals('43.06132', $geoCodeResultObj4->latitude);
View
12 app/protected/modules/maps/tests/unit/walkthrough/MapsRegularUserWalkthroughTest.php
@@ -47,11 +47,11 @@ public function testRegularUserAllControllerActionsNoElevation()
$superAccount = AccountTestHelper::createAccountByNameForOwner('accountOwnedBySuper', $super);
//Create address array for the account owned by super user.
- $address = array('street1' => '1600 Amphitheatre Parkway',
+ $address = array('street1' => '36826 East Oak Road',
'street2' => '',
- 'city' => 'Mountain View',
- 'state' => 'California',
- 'postalCode' => '94043',
+ 'city' => 'New York',
+ 'state' => 'NY',
+ 'postalCode' => '10001',
'country' => 'USA'
);
@@ -64,8 +64,8 @@ public function testRegularUserAllControllerActionsNoElevation()
$accounts = Account::getByName('accountOwnedBySuper');
$this->assertEquals(1, count($accounts));
- $this->assertEquals('37.4211444', $accounts[0]->billingAddress->latitude);
- $this->assertEquals('-122.0853032', $accounts[0]->billingAddress->longitude);
+ $this->assertEquals('40.7274969', $accounts[0]->billingAddress->latitude);
+ $this->assertEquals('-73.9601597', $accounts[0]->billingAddress->longitude);
$this->assertEquals(0, $accounts[0]->billingAddress->invalid);
$addressString = $accounts[0]->billingAddress->makeAddress();
View
2  app/protected/modules/maps/tests/unit/walkthrough/MapsSuperUserWalkthroughTest.php
@@ -1 +1 @@
-<?php
+<?php
View
4 app/protected/modules/zurmo/tests/unit/ZurmoTimeZoneHelperTest.php
@@ -79,7 +79,7 @@ public function testSettingMalformedTimeZone()
$timeZoneHelper->setTimeZone('AFakeTimeZone');
$this->assertFail();
}
- catch(Exception $e)
+ catch (Exception $e)
{
//ok good, an Exception is expected to be thrown.
}
@@ -98,7 +98,7 @@ public function testSettingMalformedTimeZoneByUser()
$this->assertFalse($billy->save());
$this->assertFail();
}
- catch(Exception $e)
+ catch (Exception $e)
{
//ok good, an Exception is expected to be thrown.
}
View
4 documentation/developer/api/footer.php
@@ -1,6 +1,6 @@
<div id='generatedInfo'>Generated on $datetime</div>
<?php echo file_get_contents( "http://zurmo.org/z-footer.php" ); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
-<script src="http://zurmo.org/wp-content/themes/Zurmo/js/zurmo.js" type="text/javascript"></script>
+<script src="http://zurmo.org/wp-content/themes/Zurmo/js/zurmo.js" type="text/javascript"></script>
</body>
-</html>
+</html>
View
21 documentation/developer/api/header.php
@@ -1,22 +1,23 @@
<!DOCTYPE html>
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<html><head><meta http-equiv = "Content-Type" content = "text/html;charset = iso-8859-1">
<title>$title</title>
-<link href="http://zurmo.org/wp-content/themes/Zurmo/doxygen.css" rel="stylesheet" type="text/css">
-<link rel="shortcut icon" href='http://zurmo.org/wp-content/themes/Zurmo/zurmo-favicon.ico' />
+<link href = "http://zurmo.org/wp-content/themes/Zurmo/doxygen.css" rel = "stylesheet" type = "text/css">
+<link rel = "shortcut icon" href = 'http://zurmo.org/wp-content/themes/Zurmo/zurmo-favicon.ico' />
<!--[if lt IE 9]>
-<script src="http://zurmo.org/wp-content/themes/Zurmo/js/html5.js" type="text/javascript"></script>
+<script src = "http://zurmo.org/wp-content/themes/Zurmo/js/html5.js" type = "text/javascript"></script>
<![endif]-->
-<script type="text/javascript">
+<script type = "text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24772933-1']);
_gaq.push(['_trackPageview']);
-(function() {
-var ga = document.createElement('script'); ga.type = 'text/javascript';
+(function()
+{
+var ga = document.createElement('script'); ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-var s = document.getElementsByTagName('script')[0];
+var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
@@ -26,5 +27,5 @@
$fileName = basename($_SERVER['REQUEST_URI'], ".php");
$className = 'doxygen-' . rtrim($fileName, '.php');
?>
-<body id='<?php echo $className;?>'>
-<?php echo file_get_contents( "http://zurmo.org/z-header.php" ); ?>
+<body id = '<?php echo $className;?>'>
+<?php echo file_get_contents( "http://zurmo.org/z-header.php" ); ?>
Please sign in to comment.
Something went wrong with that request. Please try again.