Skip to content

Commit

Permalink
Adjust Implementation to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
rdohms committed Jul 28, 2021
1 parent e834447 commit 3fd975c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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 3fd975c

Please sign in to comment.