-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from ndm2/tests-fixes-and-clean-up
Tests, fixes, and clean-up.
- Loading branch information
Showing
17 changed files
with
701 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model\Filter; | ||
|
||
use Search\Model\Filter\Base; | ||
|
||
class TestFilter extends Base | ||
{ | ||
|
||
public function process() | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model\Table; | ||
|
||
use Cake\ORM\Table; | ||
use Search\Manager; | ||
|
||
/** | ||
* @mixin \Search\Model\Behavior\SearchBehavior | ||
*/ | ||
class ArticlesTable extends Table | ||
{ | ||
|
||
public function searchConfiguration() | ||
{ | ||
$manager = new Manager($this); | ||
|
||
return $manager | ||
->value('foo') | ||
->like('search', ['filterEmpty' => true]) | ||
->value('baz') | ||
->value('group', ['field' => 'Articles.group']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model\Table; | ||
|
||
use Cake\ORM\Table; | ||
use Search\Manager; | ||
|
||
/** | ||
* @mixin \Search\Model\Behavior\SearchBehavior | ||
*/ | ||
class CommentsTable extends Table | ||
{ | ||
|
||
/** | ||
* @return \Search\Manager | ||
*/ | ||
public function searchConfiguration() | ||
{ | ||
$manager = new Manager($this); | ||
|
||
return $manager | ||
->value('Comments.foo') | ||
->like('Comments.search', ['filterEmpty' => true, 'multiValue' => true]) | ||
->value('Comments.baz') | ||
->value('Comments.group', ['field' => 'Comments.group']) | ||
->value('group', ['multiValue' => true]) | ||
->value('published'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model\Table; | ||
|
||
use Cake\ORM\Query; | ||
use Cake\ORM\Table; | ||
|
||
/** | ||
* @mixin \Search\Model\Behavior\SearchBehavior | ||
*/ | ||
class FinderArticlesTable extends Table | ||
{ | ||
public function initialize(array $config) | ||
{ | ||
parent::initialize($config); | ||
|
||
$this->table('articles'); | ||
} | ||
|
||
public function findActive(Query $query, array $options) | ||
{ | ||
return $query->where([ | ||
'Articles.is_active' => true | ||
] + $options['active']); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model\Table; | ||
|
||
use Cake\ORM\Table; | ||
use Search\Manager; | ||
|
||
/** | ||
* @mixin \Search\Model\Behavior\SearchBehavior | ||
*/ | ||
class GroupsTable extends Table | ||
{ | ||
|
||
public function searchConfiguration() | ||
{ | ||
$manager = new Manager($this); | ||
|
||
return $manager | ||
->collection('frontend') | ||
->value('title') | ||
->collection('backend') | ||
->like('title', ['before' => true, 'after' => true]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
namespace Search\Test\TestApp\Model; | ||
|
||
use Cake\Datasource\EntityInterface; | ||
use Cake\Datasource\RepositoryInterface; | ||
|
||
class TestRepository implements RepositoryInterface | ||
{ | ||
public function alias($alias = null) | ||
{ | ||
} | ||
|
||
public function hasField($field) | ||
{ | ||
} | ||
|
||
public function find($type = 'all', $options = []) | ||
{ | ||
} | ||
|
||
public function get($primaryKey, $options = []) | ||
{ | ||
} | ||
|
||
public function query() | ||
{ | ||
} | ||
|
||
public function updateAll($fields, $conditions) | ||
{ | ||
} | ||
|
||
public function deleteAll($conditions) | ||
{ | ||
} | ||
|
||
public function exists($conditions) | ||
{ | ||
} | ||
|
||
public function save(EntityInterface $entity, $options = []) | ||
{ | ||
} | ||
|
||
public function delete(EntityInterface $entity, $options = []) | ||
{ | ||
} | ||
|
||
public function newEntity($data = null, array $options = []) | ||
{ | ||
} | ||
|
||
public function newEntities(array $data, array $options = []) | ||
{ | ||
} | ||
|
||
public function patchEntity(EntityInterface $entity, array $data, array $options = []) | ||
{ | ||
} | ||
|
||
public function patchEntities($entities, array $data, array $options = []) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.