/**
* @test
*/
public function findBySearchTermReturnsFilteredResult()
{
$tag1 = new Tag('foobar');
$tag2 = new Tag('foo bar');
$tag3 = new Tag('bar foo bar');
$this->tagRepository->add($tag1);
$this->tagRepository->add($tag2);
$this->tagRepository->add($tag3);
$this->persistenceManager->persistAll();
$this->persistenceManager->clearState();
$this->assertCount(3, $this->tagRepository->findBySearchTerm('foo'));
$this->assertCount(2, $this->tagRepository->findBySearchTerm('foo bar'));
$this->assertCount(1, $this->tagRepository->findBySearchTerm(' foo '));
}