Permalink
Browse files

Fixing comments indent, AllSearchPluginTests and readme issue

  • Loading branch information...
1 parent 01b7ac2 commit 6af59a392d062e987df981ad98c2b184929271fc @ajibarra ajibarra committed Jul 16, 2012
View
14 Controller/Component/PrgComponent.php
@@ -338,13 +338,13 @@ public function commonProcess($modelName = null, $options = array()) {
}
}
- /**
- * Parse the configs from the Model (to keep things dry)
- *
- * @param array $arg
- * @param mixed $key
- * @return array
- */
+/**
+ * Parse the configs from the Model (to keep things dry)
+ *
+ * @param array $arg
+ * @param mixed $key
+ * @return array
+ */
protected function _parseFromModel($arg, $key = null) {
if (isset($arg['preset']) && !$arg['preset']) {
return false;
View
40 Model/Behavior/SearchableBehavior.php
@@ -154,12 +154,12 @@ public function unbindAllModels(Model $Model, $reset = false) {
$Model->unbindModel($unbind, $reset);
}
- /**
- * for custom queries inside the model
- * example "makePhoneCondition": $cond = array('OR' => array_merge($this->condLike('cell_number', $filter), $this->condLike('landline_number', $filter, array('before' => false))));
- *
- * @return array of conditions
- */
+/**
+ * For custom queries inside the model
+ * example "makePhoneCondition": $cond = array('OR' => array_merge($this->condLike('cell_number', $filter), $this->condLike('landline_number', $filter, array('before' => false))));
+ *
+ * @return array of conditions
+ */
public function condLike(Model $Model, $name, $data, $field = array()) {
$conditions = array();
$field['name'] = $name;
@@ -169,14 +169,14 @@ public function condLike(Model $Model, $name, $data, $field = array()) {
return $this->_addCondLike($Model, $conditions, $data, $field);
}
- /**
- * replace substitions with original wildcards
- * but first, escape the original wildcards in the text to use them as normal search text
- *
- * @param Model $Model
- * @param string $queryLikeString
- * @return string $queryLikeString
- */
+/**
+ * Replace substitions with original wildcards
+ * but first, escape the original wildcards in the text to use them as normal search text
+ *
+ * @param Model $Model
+ * @param string $queryLikeString
+ * @return string $queryLikeString
+ */
public function formatLike(Model $Model, $data, $options = array()) {
$options = am($this->settings[$Model->alias], $options);
$from = $to = $substFrom = $substTo = array();
@@ -201,12 +201,12 @@ public function formatLike(Model $Model, $data, $options = array()) {
return $data;
}
- /**
- * return the current chars for querying LIKE statements on this model
- *
- * @param Model $Model Reference to the model
- * @return array, [one=>..., any=>...]
- */
+/**
+ * Return the current chars for querying LIKE statements on this model
+ *
+ * @param Model $Model Reference to the model
+ * @return array, [one=>..., any=>...]
+ */
public function getWildcards(Model $Model, $options = array()) {
$options = am($this->settings[$Model->alias], $options);
return array('any' => $options['wildcardAny'], 'one' => $options['wildcardOne']);
View
19 Test/Case/AllPluginTestsTest.php
@@ -1,19 +0,0 @@
-<?php
-/**
- * group test - Search
- */
-class AllPluginTestsTest extends PHPUnit_Framework_TestSuite {
-
- /**
- * suite method, defines tests for this suite.
- *
- * @return void
- */
- public static function suite() {
- $Suite = new CakeTestSuite('All Plugin tests');
- $path = dirname(__FILE__);
- $Suite->addTestDirectory($path . DS . 'Controller' . DS . 'Component');
- $Suite->addTestDirectory($path . DS . 'Model' . DS . 'Behavior');
- return $Suite;
- }
-}
View
33 Test/Case/AllSearchPluginTest.php
@@ -1,22 +1,19 @@
<?php
-class AllSearchPluginTest extends PHPUnit_Framework_TestSuite {
-
/**
- * Suite define the tests for this suite
- *
- * @return void
+ * Group test - Search
*/
- public static function suite() {
- $suite = new PHPUnit_Framework_TestSuite('All Search Plugin Tests');
-
- $basePath = CakePlugin::path('Search') . DS . 'Test' . DS . 'Case' . DS;
- // components
- $suite->addTestFile($basePath . 'Controller' . DS . 'Component' . DS . 'PrgComponentTest.php');
-
- // behaviors
- $suite->addTestFile($basePath . 'Model' . DS . 'Behavior' . DS . 'SearchableBehaviorTest.php');
-
- return $suite;
- }
+class AllSearchPluginTest extends PHPUnit_Framework_TestSuite {
-}
+ /**
+ * suite method, defines tests for this suite.
+ *
+ * @return void
+ */
+ public static function suite() {
+ $Suite = new CakeTestSuite('All Plugin tests');
+ $path = dirname(__FILE__);
+ $Suite->addTestDirectory($path . DS . 'Controller' . DS . 'Component');
+ $Suite->addTestDirectory($path . DS . 'Model' . DS . 'Behavior');
+ return $Suite;
+ }
+}
View
2 readme.md
@@ -112,7 +112,7 @@ In this example on model level shon example of search by OR condition. For this
// use custom wildcards in the frontend (instead of * and ?):
'search_custom_like' => array('type' => 'like', 'encode' => true, 'before' => false, 'after' => false, 'wildcardAny' => '%', 'wildcardOne' => '_'),
// use and/or connectors ('First + Second, Third'):
- 'search_with_connectors' => array('type' => 'like', 'field' => 'Article.title', 'connectorAnd' = > '+', 'connectorOr' => ',')
+ 'search_with_connectors' => array('type' => 'like', 'field' => 'Article.title', 'connectorAnd' => '+', 'connectorOr' => ',')
);

0 comments on commit 6af59a3

Please sign in to comment.