浏览代码

bah. 1 more unit test failure/fix (great tests!)

alan bount 11 年之前
父节点
当前提交
d1929dcbf8
共有 2 个文件被更改,包括 3 次插入6 次删除
  1. 1 0
      Model/Behavior/GeocoderBehavior.php
  2. 2 6
      Test/Case/Model/Behavior/GeocoderBehaviorTest.php

+ 1 - 0
Model/Behavior/GeocoderBehavior.php

@@ -155,6 +155,7 @@ class GeocoderBehavior extends ModelBehavior {
 				}
 				return false;
 			}
+			return true;
 		}
 
 		// valid lat/lng found

+ 2 - 6
Test/Case/Model/Behavior/GeocoderBehaviorTest.php

@@ -154,10 +154,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 			'city' => 'Deutschland'
 		);
 		$res = $this->Comment->save($data);
-		//debug($this->Comment->Behaviors->Geocoder->Geocode->error()).BR;
-
+		//debug($this->Comment->Behaviors->Geocoder->Geocode->error());
 		//debug($res);
-
 		//debug($this->Comment->Behaviors->Geocoder->Geocode->debug());
 		$this->assertTrue(!empty($res['Comment']['lat']) && !empty($res['Comment']['lng']));
 	}
@@ -173,10 +171,8 @@ class GeocoderBehaviorTest extends CakeTestCase {
 			'city' => 'Deutschland'
 		);
 		$res = $this->Comment->save($data);
-		//debug($this->Comment->Behaviors->Geocoder->Geocode->error()).BR;
-
+		//debug($this->Comment->Behaviors->Geocoder->Geocode->error());
 		//debug($res);
-
 		//debug($this->Comment->Behaviors->Geocoder->Geocode->debug());
 		$this->assertTrue(!isset($res['Comment']['lat']) && !isset($res['Comment']['lng']));
 	}