Skip to content

Commit

Permalink
Always applied criteria (#78)
Browse files Browse the repository at this point in the history
* Introducing always applied criteria

* Simplest test for AlwaysAppliedCriteria
  • Loading branch information
krzysztof-gzocha committed Jul 28, 2016
1 parent 9423b9a commit 965a678
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/KGzocha/Searcher/Criteria/AlwaysAppliedCriteria.php
@@ -0,0 +1,17 @@
<?php

namespace KGzocha\Searcher\Criteria;

/**
* @author Krzysztof Gzocha <krzysztof@propertyfinder.ae>
*/
class AlwaysAppliedCriteria implements CriteriaInterface
{
/**
* @inheritDoc
*/
public function shouldBeApplied()
{
return true;
}
}
18 changes: 18 additions & 0 deletions tests/Criteria/AlwaysAppliedCriteriaTest.php
@@ -0,0 +1,18 @@
<?php

namespace KGzocha\Searcher\Test\Criteria;

use KGzocha\Searcher\Criteria\AlwaysAppliedCriteria;

/**
* @author Krzysztof Gzocha <krzysztof@propertyfinder.ae>
*/
class AlwaysAppliedCriteriaTest extends \PHPUnit_Framework_TestCase
{
public function testShouldBeApplied()
{
$criteria = new AlwaysAppliedCriteria();

$this->assertTrue($criteria->shouldBeApplied());
}
}

0 comments on commit 965a678

Please sign in to comment.