Skip to content

Commit

Permalink
Merge pull request #229 from rdohms/task/widen-dms-filter
Browse files Browse the repository at this point in the history
Allow v4 of DMS filter
  • Loading branch information
rdohms authored Jul 28, 2021
2 parents 1d7949d + 3fd975c commit 4cba66c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

"require": {
"php": "^7.4 || ^8.0",
"dms/dms-filter": "^2.0 | ^3.0",
"dms/dms-filter": "^2.0 | ^3.0 | ^4.0",
"symfony/config": "^5.0",
"symfony/yaml": "^5.0",
"symfony/framework-bundle": "^5.0",
Expand Down
26 changes: 14 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setContainer(?ContainerInterface $container = null): void
*
* @throws UnexpectedValueException
*/
public function getFilterForRule(Rule $rule)
public function getFilterForRule(Rule $rule): BaseFilter
{
$filterIdentifier = $rule->getFilter();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use DMS\Filter\Rules\StripTags;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use stdClass;
use Symfony\Component\DependencyInjection\ContainerInterface;

class ContainerAwareLoaderTest extends TestCase
Expand All @@ -20,11 +19,11 @@ class ContainerAwareLoaderTest extends TestCase
public function testGetFilterForRule(): void
{
$this->container->expects($this->once())->method('has')->will($this->returnValue(true));
$this->container->expects($this->once())->method('get')->will($this->returnValue(new stdClass()));
$this->container->expects($this->once())->method('get')->will($this->returnValue(new StripTagsFilter()));

$filter = $this->loader->getFilterForRule(new StripTags());

$this->assertInstanceOf(stdClass::class, $filter);
$this->assertInstanceOf(StripTagsFilter::class, $filter);
}

public function testGetFilterForRuleCascade(): void
Expand Down

0 comments on commit 4cba66c

Please sign in to comment.